-
Notifications
You must be signed in to change notification settings - Fork 151
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
SNOW-1232488 Column names are converted to lowercase #157
Comments
@keller00 I see you self-assigned this. Does that mean you're working on this? If so, got a rough timeline? |
I will when I find some time, I'm just trying to let you know that I have looked at it. But if yo need this in a short time frame, then I'd encourage you to open a PR, this helps us out immensely even if we end up fixing bugs in the PR submitted. This whole issue comes from the fact that if you single quote in Snowflake then it is case sensitive, while not quoting something makes the string upper case by default. |
This causes issues with tools like Apache Superset that use introspection and column name matching to have shared filters across multiple visualizations. Sometimes the columns are full uppercase and sometimes they aren't. |
Hi, I'm sorry for the annoying question, but are there any updates on this one? |
Wouldn't it make more sense for it to be uppercase? Snowflake defaults to returning column names as uppercase. |
Same issue here, but if you mix upper case and lower case it obeys: Edit: Found this: #73
Continuing with the code given above:
Instead of using pandas (pd.read_sql) I just updated my code to run the following:
|
@keller00 @sfc-gh-abhatnagar Do you think you can assign this to someone else that works on the project? It's a pretty difficult bug to work around. |
+1! |
Since this behavior is fundamentally broken, we had to work around this in ibis in ibis-project/ibis#5741. If you use ibis, we do the minimum amount of munging need to make things work and we preserve the quoting behavior of snowflake instead of the broken behavior in snowflake-sqlalchemy. |
We are also maintaining internal workarounds for the broken case handling. Would be very helpful to have this fixed inside snowflake-sqlalchemy itself, especially since it is such a fundamental issue that is already known for years and should be rather straightforward to fix. It even seems that This issue even extends to snowflake.connector, where e.g. some table names are simply converted to uppercase (connector.pandas_tools.pd_writer). So you need to maintain a workaround there as well if you want to support mixed case handling.
|
hi folks - apologies for leaving this unanswered for so long; we're changing that going forward.
might be all originating from the same gap in snowflake-sqlalchemy. At this time, I cannot promise any timeline for taking care of this, but rest assured we're aware of the issue and i'll keep this thread posted. |
in case anyone else getting the same confusion, it looks like
.read_sql( 'SELECT 1 AS col' )['col'] --> pass .read_sql( 'SELECT 1 AS _col' )['_col'] --> fail |
All column names, irrespective of their casing in the Snowflake database, seem to be converted to lower-case.
python --version
)?3.7.3
python -c 'import platform; print(platform.platform())'
)?Linux-4.15.0-1060-aws-x86_64-with-debian-buster-sid
pip list
)?(which is the column names I get when I grab the query result using the Snowflake Connector's
fetch_pandas_all()
.The text was updated successfully, but these errors were encountered: