[coverage] Conformance findings: PARAMQUERY-022

オープン 初心者向け
#887 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
databases

調査の方向性

DecimalParameter._cast_expr から始め、issue で説明されている CAST_EXPR.format の呼び出しを調べます。Coverage PR の tests/ の diff を使って test_decimal_target_carries_declared_precision_and_scale を見つけ、そのテストを実行します。完了の条件は、SELECT ? AS v が宣言された DECIMAL(10,2) の形状を保持し、期待される 123.45 Decimal128 の結果が通ることです。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
233
フォーク
152
平均マージ
21時間 5分
マージ済み PR(30日)
10

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

databricks/databricks-sql-python のほかの issue

databricks/databricks-sql-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。