[coverage] Conformance findings: DATATYPE-041

Đang mở
#895 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python, sql
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu với test bị lỗi test_decimal_text_rendering_without_scientific_notation trong coverage PR diff dưới tests/, sau đó lần theo cách Python connector hiển thị các giá trị DECIMAL dưới dạng văn bản. So sánh hành vi dự kiến với PR tham chiếu 134; được coi là hoàn tất khi các assertion DATATYPE-041 vượt qua với ký hiệu thông thường ở scale đã khai báo, bao gồm cả 0.0000001.

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

  • DATATYPE-041 [thrift]: DECIMAL text surface uses scientific notation at high scale: a DECIMAL(20,7) 0.0000001 renders as "1E-7" instead of plain "0.0000001" at the declared scale, because the connector returns a decimal.Decimal whose stdlib str switches to exponent form below adjusted exponent -6 (PECOBLR-2096)
    • failing test: test_decimal_text_rendering_without_scientific_notation (see the coverage PR diff under tests/)
  • DATATYPE-041 [sea]: DECIMAL text surface uses scientific notation at high scale on the SEA/kernel backend too: a DECIMAL(20,7) 0.0000001 renders as "1E-7" instead of plain "0.0000001" at the declared scale (PECOBLR-2096)
    • failing test: test_decimal_text_rendering_without_scientific_notation (see the coverage PR diff under tests/)
  • DATATYPE-041: DECIMAL text surface uses scientific notation at high scale: a DECIMAL(20,7) 0.0000001 renders as "1E-7" instead of plain "0.0000001" at the declared scale, because the connector returns a decimal.Decimal whose stdlib str switches to exponent form below adjusted exponent -6 — consumers reading the column as text (CSV export, f-string/str formatting, BI tools) get an exponent form where the reference driver emits plain digits (PECOBLR-2096)

Reproduce & Expected

DATATYPE-041 — Verify that when a driver renders a DECIMAL column as text, the rendering is PLAIN decimal notation carrying the column's declared scale -- never scientific notation, never a re-scaled or truncated m…

Expected (per the shared spec):

  • result has exactly 1 row(s)
  • col zero_scaled, row 0 == 0
  • col sub_one, row 0 == 0.5
  • col neg_sub_one, row 0 == -0.05
  • col sub_one_high_scale, row 0 == 1e-07
  • col trailing_zeros, row 0 == 100.0
  • col wide_magnitude, row 0 == 1.2345678901234568e+26
  • full assertion contract:
result:
- row_count: 1
- column:
    name: zero_scaled
    equals: 0
- column:
    name: sub_one
    equals: 0.5
- column:
    name: neg_sub_one
    equals: -0.05
- column:
    name: sub_one_high_scale
    equals: 1.0e-07
- column:
    name: trailing_zeros
    equals: 100.0
- column:
    name: wide_magnitude
    equals: 1.2345678901234568e+26
- decimal_text_plain_notation:
    columns:
    - zero_scaled
    - sub_one
    - neg_sub_one
    - sub_one_high_scale
    - trailing_zeros
    - wide_magnitude

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.