snowflake-sqlalchemy icon indicating copy to clipboard operation
snowflake-sqlalchemy copied to clipboard

Fix fallback to NullType when dialect type not found

Open Rustem opened this issue 4 years ago • 7 comments

GEOGRAPHY custom type is not supported yet. Decided to fix issue similarly how sqlalchemy/postgresql dialect fixes it using sqlalchemy generic type called NULLTYPE. For more information see here

Root cause: sqltypes.NULLTYPE is already an instance of sqltypes.NullType, however when type is not supported logic does not account for that and tries to initalize already initialized instance.

Related Issue: https://github.com/snowflakedb/snowflake-sqlalchemy/issues/194

Rustem avatar Feb 15 '21 00:02 Rustem

Ok tested this workaround on few tables that contain geography and without it, now it works!

Rustem avatar Feb 15 '21 18:02 Rustem

Could you help to merge this bug fix asap please? As we temporarily patched the dialect on our end.

Rustem avatar Feb 17 '21 16:02 Rustem

We have same problem with dialect. Can you please merge this pull request. @sfc-gh-kwagner @sfc-gh-mkeller

Mafioso avatar Feb 18 '21 16:02 Mafioso

Any plans to merge this? This looks like a good hotfix to integrate. engine.dialect.get_columns() is unusable due to this if any table in schema contains a GEOGRAPHY column.@sfc-gh-kwagner @sfc-gh-mkeller

emreakg avatar Jul 30 '21 21:07 emreakg

+1 GEOGRAPHY columns are causing issues

nikhiltjoy-dd avatar Sep 21 '21 18:09 nikhiltjoy-dd

+1 for merge request. I am getting this error as well when trying to do df.to_sql if any table in schema contains a GEOGRAPHY column.

hadia206 avatar Feb 10 '22 18:02 hadia206

+1 for merge request. I am getting this error as well when trying to do df.to_sql if any table in schema contains a GEOGRAPHY column.

+1 on the merge request. I have verified that applying this change resolves my issues.

njriasan avatar Feb 14 '22 15:02 njriasan