523
|
|
|
Eddie Hebert |
6 years ago
|
|
|
522
|
|
|
Joe Jevnik |
6 years ago
|
|
|
521
|
|
|
Eddie Hebert |
6 years ago
|
|
|
520
|
|
BUG: Fix reflection Postgres double precision columns.
A double precision column in a Postrges table, whose dshape specified a dtype of `float64` for that column, would return a decimal dtype.
Fix by defining a group of types which are 'precision' types, and check for membership in that before attempting to lookup the typeengine typ in `blaze.backends.sql.revtypes`
Without the fix applied the newly added test fails with the following assertion error, when comparing the `discover` of the `bind` with the expected values: ``` @assert_dshape_equal.register(object, object) def _base_case(a, b, path=None, **kwargs): > assert a == b, '%s != %s\n%s' % (a, b, _fmt_path(path)) E AssertionError: decimal[precision=53, scale=None] != float64 E path: _.measure['a'] ```
Also, added `sa.Float` as a precision type, which fixes `sa.Float(precision=24)`; this allows removal of the `xfail` marking in `odo/backends/test/test_sql::test_types`.
|
Eddie Hebert |
6 years ago
|
|
|
519
|
|
|
Eddie Hebert |
6 years ago
|
|
|
518
|
|
BUG: Fix discover for sa.TIMESTAMP.
`discover` was returning a bytes dtype for the `sa.TIMESTAMP` instead of `datetime_`.
That bug was because the SQLAlchemy dialect for MSSQL currently directly imports `sa.TIMESTAMP`, causing a collision in `odo.backends.sql.revtypes`.
Fix by 1) creating a subclass of `mssql.TIMESTAMP` to use as the key in `revtypes` so that it does not overwrite `sa.TIMESTAMP` 2) assign that subclass to the mssql dialect's `'TIMESTAMP'` (using `ischema_names`), so that the subclass will be returned by the type engine instead of `mssql.TIMESTAMP`.
The added test for the (`sa.TIMESTAMP`, `datetime_`) without the fix applied would result in this error: ``` a = Bytes(), b = DateTime(tz=None), path = ('.measure', "['ts']", '.ty') kwargs = {'check_dim': True, 'check_record_order': True}
@assert_dshape_equal.register(object, object) def _base_case(a, b, path=None, **kwargs): > assert a == b, '%s != %s\n%s' % (a, b, _fmt_path(path)) E AssertionError: bytes != datetime E path: _.measure['value'].ty ```
This patch includes checks for the other types besides `sa.TIMESTAMP` for better protection against the general case of failures when using `revtypes` to map SQLAlchemy types to dtypes.
Those extra cases exposed an issue with `sa.Float(precision=24)`. That case is commented out to keep the fix of this patch on the `sa.TIMESTAMP` mapping. (I would have used `pytest.param` to mark it xfail, but pytest for this project needs to be upgraded first.)
See: https://github.com/blaze/odo/issues/567 https://github.com/blaze/odo/pull/568 https://bitbucket.org/zzzeek/sqlalchemy/issues/4092/type-problem-with-mssqltimestamp https://github.com/blaze/blaze/pull/1656
|
Eddie Hebert |
6 years ago
|
|
|
517
|
|
|
Eddie Hebert |
6 years ago
|
|
|
516
|
|
|
Richard Postelnik |
6 years ago
|
|
|
515
|
|
|
David Lakata |
6 years ago
|
|
|
514
|
|
|
Michael Herman |
6 years ago
|
|
|
513
|
|
|
dhirschf |
6 years ago
|
|
|
512
|
|
|
dhirschf |
6 years ago
|
|
|
511
|
|
|
dhirschf |
6 years ago
|
|
|
510
|
|
|
dhirschf |
6 years ago
|
|
|
509
|
|
|
timcera |
6 years ago
|
|
|
508
|
|
|
dhirschf |
6 years ago
|
|
|
507
|
|
|
dhirschf |
6 years ago
|
|
|
506
|
|
|
dhirschf |
6 years ago
|
|
|
505
|
|
|
dhirschf |
6 years ago
|
|
|
504
|
|
|
Dave Hirschfeld |
6 years ago
|
|
|