snowflake-connector-python: SNOW-735220: pd_writer example from documentation not working
Please answer these questions before submitting your issue. Thanks!
- What version of Python are you using?
Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:23:14) [GCC 10.4.0]
- What operating system and processor architecture are you using?
Linux-5.4.0-1094-aws-x86_64-with-glibc2.31
- What are the component versions in the environment (
pip freeze)?
mamba list | grep -e snow -e pandas
pandas 1.5.2 py310h769672d_0 https://conda.anaconda.org/conda-forge
snowflake-connector-python 2.8.3 py310hea2c3ac_0 https://conda.anaconda.org/conda-forge
snowflake-sqlalchemy 1.3.4 pyhd8ed1ab_0 https://conda.anaconda.org/conda-forge
I also tried with snowflake-sqlalchemy 1.4.5
- What did you do?
Run this example from the documentation
import pandas
from snowflake.connector.pandas_tools import pd_writer
# Create a DataFrame containing data about customers
df = pandas.DataFrame([('Mark', 10), ('Luke', 20)], columns=['name', 'balance'])
# Specify that the to_sql method should use the pd_writer function
# to write the data from the DataFrame to the table named "customers"
# in the Snowflake database.
df.to_sql('customers', engine, index=False, method=pd_writer)
- What did you expect to see?
Expected the example to work, but got
snowflake.connector.errors.ProgrammingError: 000904 (42000): 01aa0467-3201-91be-0000-1e695e9861c6: SQL compilation error: error line 1 at
position 92
invalid identifier '"name"'
- Can you set logging to DEBUG and collect the logs?
/
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 28 (8 by maintainers)
Are you guys fine with incorrect documentation?
This issue is slowly becoming a meme
I see how setting
quote_identifierstoFalsedoes not work for column names that are case-sensitive. I will take a look again soon and see what the best approach is here.We will look at this issue this week. FYI @sfc-gh-stan