Closed jm-nab closed 16 hours ago
@jm-nab you are trying to create index in snowflake which is not supported. Do you know where create index statement is generated from?
@sfc-gh-aalam It's created by adding index=True
on a field. Is there any clever or more descriptive ways to make it easier to transition a current models/schemas to snowflake?
For example the use case is where there is an app which has a model working on sqlite/postgres, etc. However, its not intuitive the differences in transitioning between the dialects. I think the case could be made that when using sqlalchemy, the transition code for snowflake handling classical RDBMS paradigms are warned and ignored?
Would it be possible to override/modify the compiler such that the transition between the two would be more intuitive? Such as adding warnings that index creation is being skipped because its not needed/supported? If its not supported it would be nice if there was a way to have it automated.
Thanks for the quick response!
hey @jm-nab , I agree with you that it's the dialect's duty to make sure the gaps are properly addressed. e.g., for the case of yours, a user-friendly error shall be raised or this shall just be a no-op to snowflake.
we have tried to cover most of the APIs, but it's challenging to cover all of them, there are cases like parameters will affect the behavior and our tests don't cover.
Is there any clever or more descriptive ways to make it easier to transition a current models/schemas to snowflake?
there isn't such a way at the moment, I would recommend if you encounter such issue, check whether it's supported in snowflake first, and maintain the list of the gaps you identified and let us know.
Would it be possible to override/modify the compiler such that the transition between the two would be more intuitive?
yes, definitely, this should be way how a dialect works, we have defined our customized compiler logic here: https://github.com/snowflakedb/snowflake-sqlalchemy/blob/main/src/snowflake/sqlalchemy/base.py
with this being said, you're more than welcome to make a PR to help improve the lib!
@sfc-gh-aling do you know if this sort of stuff would be resolved by using the currently in private preview "hybrid tables"?
For example, instead of using snowflake OLAP/hybrid tables, i've opted to use postgres and a kafka cluster/kafka-connect, since it is a "production ready", tried, and tested path.
Does Snowflake plan to commit any staffing resources to support big libraries like sqlalchemy for the feature parity between dialects?
It was a big factor for me not adopting "hybrid tables", on the project I am currently working on.
Thanks for the responses! Much appreciated.
Hybrid Tables are not supported yet unfortunately for snowflake-sqlalchemy, and at this moment there is no timeline attached to when it would be.
For the rest of the request, I'd rely on Adam's response from earlier and indeed if resources permit, PRs are more than welcome to address the already-identified gaps.
(Hybrid Table support) released with version 1.7.0 in November 2024 release cycle
@sfc-gh-dszmolka @sfc-gh-jvasquezrojas Awesome! Thank you!
Please answer these questions before submitting your issue. Thanks!
3.11
ubuntu 22.04
pip freeze
)?@latest
alembic upgrade head
SUCCESS