Time is rendered as DATETIME, so a time-of-day is silently stored as a 1970-01-01 timestamp
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
調査の方向性
まず、issue に記載されている CREATE TABLE と型付きまたは型なしの読み取りを再現し、次に SQLAlchemy Core の Time 型に対する dialect のコンパイルエントリポイントを追跡します。未サポートの Time がコンパイル時に拒否されるか、日付を勝手に作らずに TEXT を使用すれば完了です。reflection と汎用的な読み取りで、1970-01-01 のタイムスタンプが暗黙的に公開されてはなりません。
索引モデルが issue の本文から書いたものです。
説明
Versions
- databend-sqlalchemy 0.5.5
- databend-driver 0.34.2
- SQLAlchemy 2.0.51
- Python 3.12.9, macOS
- Server:
datafuselabs/databend:v1.2.925-patch-4in Docker
What happens
Databend has no time-of-day type. Its parser says so by listing what it will take:
CREATE TABLE probe (clock TIME)
-> unexpected `TIME`, expecting `TIMESTAMP`, `TIMESTAMP_TZ`, `TEXT`, … `DATE`, … `DATETIME`, …
The dialect renders Core's Time as DATETIME. The column is created, and the substitution is invisible from Core, because SQLAlchemy's own Time type re-derives the value on the way out:
- typed
select()on the column hands backtime(14, 30)— looks correct - the same column read without the Core type in play is
1970-01-01T14:30:00Z inspect()reports the column type asDATETIME
So it round-trips correctly through a typed Core select and is wrong through everything else: reflection, any consumer reading the column generically, anything comparing against another engine's storage of the same value.
Why this is the awkward failure mode
A column that couldn't be created is a five-minute problem. A column that exists and quietly holds a different type is the kind that surfaces months later, in whichever consumer wasn't going through Core's typed path. The date part isn't neutral either — it's a real 1970-01-01 sitting in the data, and it sorts and compares as one.
Suggested fix
Refuse Time at compile time on an engine that has no such type, the same way an unsupported type is refused elsewhere. If a substitution is preferred over a refusal, TEXT at least doesn't invent a date, but I'd rather it just raised.
- 主要言語
- Python
- スター
- 15
- フォーク
- 5
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
databendlabs/databend-sqlalchemy のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Index.create() reports success and creates nothing: the compiler emits an empty string and the connector returns early対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
do_rollback() swallows the connector's NotSupportedError, so a rollback reports success over a write that stands対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
databendlabs/databend-sqlalchemy#58 · コメント 1 件 ·
databendlabs/databend-sqlalchemy の issue をすべて見る
似ている issue
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocation対応中かも @lechakrawarthy が今日担当しました。 オープンbug good first issue help wanted idempotency
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
aws-powertools/powertools-lambda-python#8728 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
emeraldleaf/okl#320 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
mnemosyne-oss/mnemosyne#1309 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/diffusers#15163 ·
メンテナーはふだん 1 日以内に返信
-
integration: ring
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
home-assistant/core#189787 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信