Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`Cursor().description` reports NULL (VOID) and INTERVAL fields as `'string'`

Open
#336 1 comment 0 reactions 1 assignee View on GitHub

@susodapop is already working on this.

Since Jan 29, 2024.

Assessment

This issue has not been assessed yet.

Description

bug

When querying NULL or INTERVAL columns from a Databricks SQL warehouse, the connector Cursor().description property 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)
[('NULL', 'string', None, None, None, None, None), ('CAST(NULL AS VOID)', 'string', None, None, None, None, None), ("INTERVAL '13' MONTH", 'string', None, None, None, None, None)]
[Row(NULL=None, CAST(NULL AS VOID)=None, INTERVAL '13' MONTH='1-1')]
[('NULL', 'string', None, None, None, None, None), ('CAST(NULL AS VOID)', 'string', None, None, None, None, None), ("INTERVAL '13' MONTH", 'string', None, None, None, None, None)]
Dominant language
Python
Stars
233
Forks
152
Avg merge
21h 5m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/databricks-sql-python

All issues in databricks/databricks-sql-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.