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

support new Cursor attribute that provides information on completed commands

Aperta
#388 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python, sql
Ambito
databases

Direzione di ricerca

Inizia con DatabricksConnectionManager.get_response() in dbt-databricks, dove l'issue identifica il messaggio "OK" hardcoded, e analizza il cursore del connettore e la gestione dei risultati dei comandi. Confronta l'output desiderato con i tag CommandComplete di PostgreSQL e con gli attributi del driver elencati. Il lavoro è completato quando i comandi completati espongono un attributo appropriato del cursore e get_response() riporta l'operazione e il conteggio delle righe interessate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

similar to: https://github.com/aws/amazon-redshift-python-driver/issues/220

While a Cursor attribute providing SQL State Code is not officially a part of PEP 249: Python DB API 2.0 spec, it's a common enough convention and would greatly enhance the user experience of dbt-databricks users (👀 @benc-db)

Many database drivers provide this as a Cursor attribute, dbt was able to depend on these drivers to provide it for a ConnectionManager.get_response() method, which reports to users after successful queries the kind of operation performed (SELECT, INSERT, CREATE) and the numbers of rows affected.

However, this is not fully supported today in dbt-databrick, see DatabricksConnectionManager.get_response() where message is hardcoded as "OK" instead of returning more information.

Support for SQL state amongst popular analytics database drivers
Driver Cursor attribute (docs)
psycopg2 statusmessage
snowflake-connector-python sqlstate
Ideal implementation

Follow Postgres's CommandComplete message

Command Tag rows indicates the number of rows
INSERT INSERT 0 rows inserted
DELETE DELETE rows deleted
UPDATE UPDATE rows updated
MERGE MERGE rows inserted, updated, or deleted
SELECT / CREATE TABLE AS SELECT rows retrieved
MOVE MOVE rows ursor's position has been changed by
FETCH FETCH rows that have been retrieved from the cursor
COPY COPY rows copied, only in PostgreSQL 8.2 and later
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.