[coverage] Conformance findings: STATEMENT-028

Đang mở Phù hợp với người mới
#1,012 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, databases

Hướng nghiên cứu

Bắt đầu với _check_command_not_in_error_or_closed_state và bài kiểm thử đang lỗi test_failed_operation_error_exposes_server_sql_state trong diff của PR về coverage tại tests/. Theo dõi cách xử lý payload trạng thái thao tác cuối cùng và nơi phát sinh ServerOperationError. Công việc hoàn tất khi lỗi hiển thị SQLSTATE do máy chủ báo cáo nếu payload có trường này, và bài kiểm thử được nêu chạy thành công.

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

  • STATEMENT-028 [thrift]: Thrift backend drops the failed operation's server-reported SQLSTATE: _check_command_not_in_error_or_closed_state raises ServerOperationError from the terminal operation-status payload but never forwards that payload's top-level sqlState, so the error exposes no sql_state — while the kernel backend sets that exact attribute on the same exception class, making SQLSTATE availability depend on which wire protocol delivered the failure
    • failing test: test_failed_operation_error_exposes_server_sql_state (see the coverage PR diff under tests/)

Reproduce & Expected

STATEMENT-028 — Validates that a statement which COMPILES and then FAILS AT RUNTIME on the server raises an error carrying the server-reported SQLSTATE as first-class error metadata -- a dedicated field/accessor on…

Reproduce:

SELECT raise_error('boom')

Expected (per the shared spec):

  • full assertion contract:
result:
- error:
    present: true
- error:
    contains:
    - boom
- error_sql_state:
    present: true
    length: 5
  condition: the terminal operation-status payload carried a SQLSTATE for the failed
    operation
  description: 'The error exposes a 5-character SQLSTATE. Gated on the server actually
    sending one:

    if the terminal payload carries none the driver must NOT invent one, and a surface

    that mandates a SQLSTATE may report its own generic state (e.g. ODBC `HY000`).

    '
- error_sql_state:
    equals_wire_value: true
  condition: the terminal operation-status payload carried a SQLSTATE for the failed
    operation
  description: 'Equal to the operation-level SQLSTATE the protocol blocks below locate
    on the wire

    for this run.

    '
- error_sql_state:
    not_equals: '00000'
  description: 'Never the enclosing status/transport envelope''s success SQLSTATE
    -- that envelope

    reports that the status call succeeded, not how the query failed.

    '
protocol:
  thrift:
  - response_field:
      method: GetOperationStatus
      path: sqlState
      present: true
      occurrence: last
      condition: GetOperationStatus response operationState == ERROR_STATE
  - response_field:
      method: GetOperationStatus
      path: status.statusCode
      equals: SUCCESS_STATUS
      occurrence: last
      condition: GetOperationStatus response operationState == ERROR_STATE
  sea:
  - response_field:
      operation: ExecuteStatement
      path: status.sql_state
      present: true
      occurrence: last
      condition: execute response status.state == FAILED
  - response_field:
      operation: GetStatementStatus
      path: status.sql_state
      present: true
      occurrence: last
      condition: status response status.state == FAILED

Context

Ngôn ngữ chính
Python
Star
236
Fork
162
Merge trung bình
13 giờ 13 phút
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của databricks/databricks-sql-python

Tất cả issue của databricks/databricks-sql-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.