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

find tables inside non-default schema when serving off a metadata #1145

Merged
merged 2 commits into from Jun 25, 2015

Conversation

@llllllllll
Copy link
Member

commented Jun 22, 2015

The name of a table include the schema prefix which would disallow us from finding a table in a metadata object if it was not the default schema. This goes with: blaze/odo#242

The '.',join is okay because that is what the key will look like when you have a dotted schema name:

In [2]: import sqlalchemy as sa

In [3]: ds = bz.Data(sa.MetaData('postgresql://localhost/test', schema='wow.this.sucks'))

In [4]: ds.data.tables
Out[4]: immutabledict({'wow.this.sucks.test': Table('test', MetaData(bind=Engine(postgresql://localhost/test)), Column('a', INTEGER(), table=<test>), schema='wow.this.sucks')})

@llllllllll llllllllll force-pushed the quantopian:single-metadata branch from a94719c to 88388fc Jun 22, 2015

@cpcloud

This comment has been minimized.

Copy link
Member

commented Jun 25, 2015

Somewhat related: Should we discover all schemata in the database if just a database is given to resource?

For example:

d = Data('postgresql://localhost/db')
d.my_schema.table1  # not the default schema
d.table1  # public schema

We can merge this PR before deciding on this.

@llllllllll

This comment has been minimized.

Copy link
Member Author

commented Jun 25, 2015

I think that would be a great addition; I will work on that as a separate pr. Does this pr look good though?

@cpcloud

This comment has been minimized.

Copy link
Member

commented Jun 25, 2015

yep 👍

@cpcloud cpcloud added this to the 0.8.1 milestone Jun 25, 2015

llllllllll added a commit that referenced this pull request Jun 25, 2015

Merge pull request #1145 from quantopian/single-metadata
find tables inside non-default schema when serving off a metadata

@llllllllll llllllllll merged commit dc59300 into blaze:master Jun 25, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@llllllllll llllllllll deleted the quantopian:single-metadata branch Jun 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.