[coverage] Conformance findings: PARAMQUERY-022

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

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
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu tại DecimalParameter._cast_expr và kiểm tra lệnh gọi CAST_EXPR.format được mô tả trong issue. Sử dụng diff của tests/ trong PR về coverage để tìm test_decimal_target_carries_declared_precision_and_scale, sau đó chạy test đó; được xem là hoàn tất khi SELECT ? AS v giữ nguyên dạng DECIMAL(10,2) đã khai báo và kết quả 123.45 Decimal128 như mong đợi vượt qua.

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

  • PARAMQUERY-022 [thrift]: DecimalParameter._cast_expr formats the DECIMAL cast with its arguments transposed — CAST_EXPR.format(self.scale, self.precision) — so a declared precision=10/scale=2 target emits DECIMAL(2,10) (scale greater than precision, invalid) instead of DECIMAL(10,2), losing the declared decimal shape on the wire
    • failing test: test_decimal_target_carries_declared_precision_and_scale (see the coverage PR diff under tests/)

Reproduce & Expected

PARAMQUERY-022 — Verify a DECIMAL/NUMERIC target with a declared precision and scale sends the parameter as a DECIMAL carrying THAT precision/scale, so the bare-marker result column is a decimal of the declared shape and the fractional digits survive.

Reproduce:

SELECT ? AS v

Expected (per the shared spec):

  • result has exactly 1 row(s)
  • col 0, row 0 == '123.45' (type Decimal128)
  • full assertion contract:
result:
- row_count: 1
- column:
    index: 0
    row: 0
    type: Decimal128
    equals: '123.45'
- result_column_type_matches_target: true

Context

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

Mở hướng dẫn đóng góp

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.