Array columns return raw values instead of Python types

オープン
#308 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python, sqlalchemy
領域
databases

調査の方向性

No file or test is named. Start by locating the dialect's generic ARRAY handling and compare it with SQLAlchemy's postgresql.ARRAY behavior, then review issue #267. Done means array elements use the declared type's result conversion while generic ARRAY operators remain supported and the reported contains() behavior stays clear.

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

説明

bug

(found while discussing #300)

A column declared as sa.ARRAY(T) returns its elements as the driver delivers them, without the conversion T applies to a single value:

DateTime        -> datetime.datetime(2026, 9, 21, 12, 0)
ARRAY(DateTime) -> [1789992000000]
Numeric(10, 2)  -> Decimal('1.25')
ARRAY(Numeric)  -> [1.25]

SQLAlchemy's generic ARRAY never runs the element type's result processor. postgresql.ARRAY does, and on the same table it returns [datetime(...), None] and [Decimal('1.25')]. It can't be used as is, though: its contains() renders @>, which crate rejects with a parse error, where the generic type raises a clear NotImplementedError. So the dialect needs an array type that converts elements and keeps the generic operators.

This overlaps with #267.

主要言語
Python
スター
9
フォーク
6
平均マージ
6日 13時間
マージ済み PR(30日)
8

環境構築

はじめの一歩

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

crate/sqlalchemy-cratedb のほかの issue

crate/sqlalchemy-cratedb の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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