Writing to Snowflake through pandas.DataFrame.to_sql when a table with datatype VECTOR exists in the schema.
What did you expect to see? What should have happened and what happened instead?
'NullType' object is not callable error is triggered, and it is impossible to write any table through pandas.DataFrame.to_sql while a table with VECTOR datatype exists.
If a table exists in the Snowflake schema having a column with datatype VECTOR, any writing to snowflake using pandas.DataFrame.to_sql will fail due to introspection. As the method get_columns reads the whole schema and there is a column of usuported datatype, method _get_schema_columns will trigger a error here.
One possible solution would be to pass the table to the query built in _get_schema_columns and avoid doing the filter only at the method return statement, if the whole table introspection is not necessary.
Can you set logging to DEBUG and collect the logs?
I believe the log is not necessary for this issue.
hi - thank you for raising this, and the detailed analysis. VECTOR is documented to be unsupported (for now) but I fully agree it shouldn't break anything still. We'll take a look.
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
3.10.9
What operating system and processor architecture are you using?
macOS-14.6.1-arm64-arm-64bit
What are the component versions in the environment (
pip freeze
)?Writing to Snowflake through
pandas.DataFrame.to_sql
when a table with datatypeVECTOR
exists in the schema.'NullType' object is not callable
error is triggered, and it is impossible to write any table throughpandas.DataFrame.to_sql
while a table withVECTOR
datatype exists.If a table exists in the Snowflake schema having a column with datatype
VECTOR
, any writing to snowflake usingpandas.DataFrame.to_sql
will fail due to introspection. As the method get_columns reads the whole schema and there is a column of usuported datatype, method_get_schema_columns
will trigger a error here.One possible solution would be to pass the table to the query built in
_get_schema_columns
and avoid doing the filter only at the method return statement, if the whole table introspection is not necessary.I believe the log is not necessary for this issue.