mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-29 12:06:28 -04:00
try < 0
This commit is contained in:
@@ -17,7 +17,7 @@ from sqlalchemy import types as sqltypes, util
|
||||
import decimal
|
||||
|
||||
class _MSNumeric_pyodbc(sqltypes.Numeric):
|
||||
"""Turns Decimals with adjusted() < -6 or > 7 into strings.
|
||||
"""Turns Decimals with adjusted() < 0 or > 7 into strings.
|
||||
|
||||
This is the only method that is proven to work with Pyodbc+MSSQL
|
||||
without crashing (floats can be used but seem to cause sporadic
|
||||
@@ -33,7 +33,7 @@ class _MSNumeric_pyodbc(sqltypes.Numeric):
|
||||
isinstance(value, decimal.Decimal):
|
||||
|
||||
adjusted = value.adjusted()
|
||||
if adjusted < -6:
|
||||
if adjusted < 0:
|
||||
return self._small_dec_to_string(value)
|
||||
elif adjusted > 7:
|
||||
return self._large_dec_to_string(value)
|
||||
|
||||
@@ -764,7 +764,6 @@ class TypesTest(TestBase, AssertsExecutionResults, ComparesTables):
|
||||
def teardown(self):
|
||||
metadata.drop_all()
|
||||
|
||||
@testing.crashes('mssql+pyodbc', 'FIXME: no clue what is up here.')
|
||||
@testing.fails_on_everything_except('mssql+pyodbc', 'this is some pyodbc-specific feature')
|
||||
def test_decimal_notation(self):
|
||||
import decimal
|
||||
|
||||
Reference in New Issue
Block a user