Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another reflection regression #70

berdario opened this issue Dec 4, 2015 · 0 comments

Another reflection regression #70

berdario opened this issue Dec 4, 2015 · 0 comments


Copy link

berdario commented Dec 4, 2015

Sorry, I should've tested this earlier as soon as you finished working on #64 , but I kept using 0.1.2 and didn't check if there were any more issues.

The issue now is with tables that have foreign keys contraints, I've been able to reproduce the problem with the following 2 tables:

create table integer identity(1, 1) not null unique);

create table
foo_id integer not null,
foreign key(foo_id) references

And, when running .reflect(only=['bar'], schema='ref')

I get *** AttributeError: 'NoneType' object has no attribute 'group'

This is the traceback:

  File "/home/dario/Projects/l2/Hydra/database/hydra_database/", line 81, in cached_metadatas
    redshiftmeta.reflect(only=tablenames, schema=schema)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/sql/", line 3647, in reflect
    Table(name, self, **reflect_opts)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/sql/", line 416, in __new__
    metadata._remove_table(name, schema)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/util/", line 60, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/sql/", line 411, in __new__
    table._init(name, metadata, *args, **kw)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/sql/", line 484, in _init
    self._autoload(metadata, autoload_with, include_columns)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/sql/", line 496, in _autoload
    self, include_columns, exclude_columns
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1477, in run_callable
    return callable_(self, *args, **kwargs)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 364, in reflecttable
    return insp.reflecttable(table, include_columns, exclude_columns)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 578, in reflecttable
    exclude_columns, reflection_options)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 666, in _reflect_fk
    table_name, schema, **table.dialect_kwargs)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 447, in get_foreign_keys
  File "<string>", line 2, in get_foreign_keys
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 54, in cache
    ret = fn(self, con, *args, **kw)
  File "/home/dario/.local/share/virtualenvs/hydra_worker/local/lib/python2.7/site-packages/sqlalchemy_redshift/", line 396, in get_foreign_keys
    referred_column ='referred_column')
AttributeError: 'NoneType' object has no attribute 'group'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant