[coverage] Conformance findings: METADATA-035,STATEMENT-023
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu với diff của PR về coverage trong tests/, đặc biệt là test_get_tables_empty_table_types_filter_matches_all và test_failed_statement_error_carries_sql_state, sau đó lần theo các đường dẫn backend Thrift tương ứng. Tái hiện câu lệnh SQL cho bảng không tồn tại và so sánh Thrift với kernel backend. Được xem là hoàn thành khi cả hai bài kiểm thử lỗi dự kiến đều thành công: table_types rỗng khớp với tất cả các loại và các câu lệnh thất bại hiển thị SQLSTATE 42P01 cùng thông báo lỗi như mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-python. Each finding is committed as an expected-failure (xfail) test in the coverage PR — the test asserts the CORRECT (post-fix) behavior and stays red until THIS driver (databricks/databricks-sql-python) is fixed, then flips green as a tripwire.
Findings
- METADATA-035 [thrift]: Thrift backend forwards an empty getTables table_types list verbatim as TGetTablesReq(tableTypes=[]), so the server treats it as match-none and returns zero rows instead of behaving like None (match all types); the kernel backend correctly normalises [] to None
- failing test:
test_get_tables_empty_table_types_filter_matches_all(see the coverage PR diff undertests/)
- failing test:
- STATEMENT-023 [thrift]: Thrift backend drops the server SQLSTATE on a FAILED statement: it builds exceptions from errorMessage/displayMessage only and never copies TStatus.sqlState / TGetOperationStatusResp.sqlState, so no PEP 249 error attribute carries 42P01 for TABLE_OR_VIEW_NOT_FOUND; the kernel backend does forward sql_state
- failing test:
test_failed_statement_error_carries_sql_state(see the coverage PR diff undertests/)
- failing test:
Reproduce & Expected
STATEMENT-023 — Validates that when the server resolves a statement to a FAILED state, the driver surfaces the server's SQLSTATE on the raised error — not just a free-text message. A statement whose SQLSTATE is stable and server-assigned is used: a reference to a table that does not exist, which Databricks reports as TABLE_OR_VIEW_NOT_FOUND with SQLSTATE 42P01. The raised error must expose that SQLSTATE through the driver's standard error surface (ADBC AdbcException.SqlState, JDBC SQLException.getSQLState(), DBAPI error attributes, ODBC SQLGetDiagRec SQLSTATE, etc.). This pins the portable half of the cross-protocol error contract: consumers branch on the status/SQLSTATE pair, so both protocols must populate it identically even though each raises its own natural concrete exception class. The CONCRETE exception TYPE is deliberately NOT asserted — it legitimately differs per protocol and per driver (the reference driver raises DatabricksException on SEA and HiveServer2Exception on Thrift), so requiring one class would encode a driver-internal detail rather than the contract.
Reproduce:
SELECT * FROM nonexistent_catalog_xyz123.nonexistent_schema.nonexistent_table
Expected (per the shared spec):
- full assertion contract:
result:
- error:
sql_state: 42P01
- error:
contains:
- TABLE_OR_VIEW_NOT_FOUND
- not found
- cannot be found
Context
- The behavior was first fixed in a DIFFERENT driver — reference PR: https://github.com/adbc-drivers/databricks/pull/604 — which seeded the shared language-neutral spec. This issue tracks the same conformance gap in databricks/databricks-sql-python; the reference PR is for cross-referencing the intended behavior, NOT a change to this repo.
- Coverage PR carrying the reproducing xfail test(s): https://github.com/databricks/databricks-driver-test/pull/1072
- Ngôn ngữ chính
- Python
- Star
- 233
- Fork
- 152
- Merge trung bình
- 21 giờ 5 phút
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của databricks/databricks-sql-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Tất cả issue của databricks/databricks-sql-python
Issue tương tự
-
fix: inaccuracy ⚠️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
uabrc/uabrc.github.io#1255 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ethereum-optimism/factory#64 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
duckdb/duckdb-python#627 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Add link for tutorial Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Qiskit/qiskit-addon-sqd#376 ·