MonetDB / sqlalchemy-monetdb

A SQLAlchemy dialect for MonetDB
MIT License
40 stars 17 forks source link

Fixed error when timestamp with timezone info is found on table refle… #32

Closed rudolfce closed 4 years ago

rudolfce commented 5 years ago

Adds support to reflection of timestamp with timezone columns and adds type error raising for unknown columns

gijzelaerr commented 5 years ago

awesome thanks, great work!

Can you maybe also add a unittest that illustrates that the fix is effective?

rudolfce commented 5 years ago

Sure thing

I just don't know for sure how to deal with the error on the django test suite importation, which seems to be what breaks the repository tests. Do you have any insights on that?

gijzelaerr commented 5 years ago

I'm not sure what error you are refering to, I've not looked at this project for a while. Can you copy paste the error here or in a gist?

rudolfce commented 5 years ago

This is what I get when I run pytest (travis seems to find the same error)

____________________________________________________________________________________________________ ERROR collecting test/test_suite.py _____________________________________________________________________________________________________
Traceback (most recent call last):
  File "/home/rudolf/src/sqlalchemy-monetdb/test/test_suite.py", line 4, in <module>
    from sqlalchemy.testing.suite import ComponentReflectionTest as _ComponentReflectionTest
  File "/home/rudolf/src/sqlalchemy-monetdb/env/lib/python3.5/site-packages/sqlalchemy/testing/suite/__init__.py", line 5, in <module>
    from .test_reflection import *  # noqa
  File "/home/rudolf/src/sqlalchemy-monetdb/env/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_reflection.py", line 50, in <module>
    class ComponentReflectionTest(fixtures.TablesTest):
  File "/home/rudolf/src/sqlalchemy-monetdb/env/lib/python3.5/site-packages/sqlalchemy/testing/suite/test_reflection.py", line 631, in ComponentReflectionTest
    @testing.requires.cross_schema_fk_reflection
AttributeError: 'Requirements' object has no attribute 'cross_schema_fk_reflection'
============================================================================================================== warnings summary ==============================================================================================================
env/lib/python3.5/site-packages/sqlalchemy/testing/plugin/pytestplugin.py:75
  /home/rudolf/src/sqlalchemy-monetdb/env/lib/python3.5/site-packages/sqlalchemy/testing/plugin/pytestplugin.py:75: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: sqlalchemy.testing.assertions
    pytest.register_assert_rewrite("sqlalchemy.testing.assertions")

-- Docs: https://docs.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
gijzelaerr commented 5 years ago

my guess is that https://github.com/gijzelaerr/sqlalchemy-monetdb/blob/master/sqlalchemy_monetdb/requirements.py is missing a cross_schema_fk_reflection element.

The requirements are listed here: https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/testing/requirements.py

it looks like this one (and maybe others) was added.