[coverage] Conformance findings: PARAMQUERY-022

Aberta Para iniciantes
#887 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Pouca atividade
Stack de tecnologia
python
Domínio
databases

Direção de pesquisa

Comece em DecimalParameter._cast_expr e inspecione a chamada CAST_EXPR.format descrita na issue. Use o diff de tests/ do PR de coverage para localizar test_decimal_target_carries_declared_precision_and_scale e, em seguida, execute esse teste; está concluído quando SELECT ? AS v preserva a forma DECIMAL(10,2) declarada e o resultado esperado 123.45 Decimal128 passa.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Python
Estrelas
233
Forks
152
Merge médio
21h 5min
PRs com merge (30d)
10

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de databricks/databricks-sql-python

Todas as issues de databricks/databricks-sql-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.