On 5/14/15 8:02 AM, Robert Buck wrote:
I am authoring a dialect for our database technology and one of the tests is failing, but I am not quite sure why, or how to proceed.

Would someone know where I'd look, or what I may be missing, to fix this aspect of the dialect?

I am likely missing something, but I've already messed with the colspecs and ischema_names hooks to no avail (not that what I've tried is right or wrong). Thoughts?

|
==============================================================================FAILURES =============================================================================== ____________________________________________________ NumericTest_nuodb_pynuodb.test_render_literal_numeric_asfloat ____________________________________________________
Traceback(most recent call last):
File"<string>",line 2,intest_render_literal_numeric_asfloat
File"/Users/rbuck/.venv/sqlalchemy/lib/python2.7/site-packages/sqlalchemy/testing/assertions.py",line 71,indecorate
returnfn(*args,**kw)
File"/Users/rbuck/.venv/sqlalchemy/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_types.py",line 368,intest_render_literal_numeric_asfloat
[15.7563],
File"<string>",line 2,in_literal_round_trip
File"/Users/rbuck/.venv/sqlalchemy/lib/python2.7/site-packages/sqlalchemy/testing/util.py",line 196,inprovide_metadata
returnfn(*args,**kw)
File"/Users/rbuck/.venv/sqlalchemy/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_types.py",line 40,in_literal_round_trip
assertvalue inoutput
AssertionError:assertDecimal('15.7563')in[15.7563]
|

this series of tests are used to detect if the target DBAPI and/or dialect returns a Numeric-typed value as a Python Decimal object or as a floating point, under a variety of conditions. This test includes the "asfloat" token so that would indicate we're using either a Float or Numeric(asdecimal=False) type object, so the value is expected as a floating point, not a Decimal. It also is using the "render_literal" fixture, which means we are rendering the value directly into the SQL rather than using a bound parameter, we're emitting an INSERT for that value, then a SELECT and expecting to get back the same thing. Since the INSERT is obviously succeeding I'd imagine you are getting more than just this failure, because the "literal" part is not what's failing here.

the fix here should involve setting the flag "supports_native_decimal = True" on the dialect in question, since a Decimal object is being produced by default which the Numeric type with asdecimal=False needs to know about so it can convert to floating point.





Thanks
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to