You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cursor().description reports NULL (VOID) and INTERVAL fields as 'string' #336
When querying NULL or INTERVAL columns from a Databricks SQL warehouse, the connector Cursor().descriptionproperty reports the type code of the columns as a 'string'. If I understand things correctly, I'd have expected it to return 'void' and 'interval', reflecting the underlying data type in Databricks SQL.
There is no definition for VOID and INTERVAL types here.
Minimal code example:
from databricks import sql
with sql.connect(
server_hostname = os.getenv("DATABRICKS_HOST"),
http_path = os.getenv("DATABRICKS_HTTP_PATH"),
access_token = os.getenv("DATABRICKS_TOKEN"),
) as connection:
with connection.cursor() as cursor:
cursor.execute("SELECT NULL, CAST(NULL AS VOID), INTERVAL '13' MONTH")
print(cursor.description)
print(cursor.fetchall())
print(cursor.description)
changed the title [-]`Cursor().description` reports NULL (VOID) and INTERVAL fields as `string`[/-][+]`Cursor().description` reports NULL (VOID) and INTERVAL fields as `'string'`[/+]on Jan 28, 2024
Thanks for the report. The code you linked to is actually part of the sqlalchemy dialect so it doesn't affect anything related to the cursor. I'll have a fix for this oddity in the next couple of weeks.
Activity
[-]`Cursor().description` reports NULL (VOID) and INTERVAL fields as `string`[/-][+]`Cursor().description` reports NULL (VOID) and INTERVAL fields as `'string'`[/+]susodapop commentedon Jan 29, 2024
Thanks for the report. The code you linked to is actually part of the sqlalchemy dialect so it doesn't affect anything related to the cursor. I'll have a fix for this oddity in the next couple of weeks.