Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#336 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@susodapop ci sta già lavorando.

Dal 29/1/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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)]
Lingua principale
Python
Stelle
233
Fork
152
Merge medio
21h 5m
PR unite (30g)
10

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di databricks/databricks-sql-python

Tutte le issue di databricks/databricks-sql-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.