-
Notifications
You must be signed in to change notification settings - Fork 139
Add type compiler. #32
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
Conversation
Neat! I know we have a dictionary from BigQuery types to SQLAlchemy types. Would it make sense to invert that dictionary and use it for these methods? I hate to have the same mapping defined in two places, but I guess this is the only place so far where we need to go from SQLAlchemy types to BigQuery types. |
Definitely don't want to duplicate logic, but it looks like the mapping in |
Yeah, you're right. That's an unfortunate fact of the fact that BigQuery still uses the legacy SQL data type names in the table API methods but we use the standard SQL data types for SQL in the DB-API connector. |
Map generic datatypes to bigquery datatypes.
dc92fb0
to
6f19d70
Compare
Amended to add a few more common types. |
Thanks @jmcarp! I've added a simple test, but it looks like sqlalchemy doesn't allow creating tables without primary keys?
|
I was testing with sqlalchemy core, which apparently does support tables without primary keys. For sqlalchemy declarative, tables without primary keys aren't supported, but I added a ddl compiler that skips foreign and primary keys on table creation. |
Thanks! |
Map generic datatypes to bigquery datatypes.
With this patch, I was able to create tables with common types via pybigquery.