- Notifications
You must be signed in to change notification settings - Fork126
Open
Description
Hi!
I am trying to insert an string array into a table with an ARRAY column, but it doesn't seem to register my Python string list.
CREATETABLEprod_catalog.eu_projects.project_export (project_idbigint, categories ARRAY<STRING>);
definsert_test():data= {"project_id":123456,"categories": ["Public Sector","Healthcare", ], }withget_databricks_connection()asconnection:cursor=connection.cursor()cursor.execute("INSERT INTO prod_catalog.eu_projects.project_export(project_id, categories) VALUES (:project_id, Array(:categories))",data )print("Test insert completed.")
This ends up as an empty array. If I check query history on the SQL Warehouse, it says that categories was an empty array []
I have tried to readthe documentation, but it is very confusing.
I am using the following versions
Python 3.13.7
databricks-sql-connector==4.1.3
databricks-sdk==0.66.0
Metadata
Metadata
Assignees
Labels
No labels