Type TAllowedParameterValue more completely
まだ誰も着手していません。
評価
調査の方向性
issue でリンクされている TAllowedParameterValue の定義がある src/databricks/sql/parameters/native.py から始めます。再帰的なアノテーションを作成する前に、コネクタが受け付けるパラメータの形状を確認し、その後 sql_params_dict を使用する wrapper でプロジェクトの厳格な pyright チェックを実行します。リスト、dict、タプルのサポート対象の値が、部分的に不明な型のエラーなしですべて型付けされていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Currently, the type definition of TAllowedParameterValue is
TAllowedParameterValue = Union[
str,
int,
float,
datetime.datetime,
datetime.date,
bool,
decimal.Decimal,
None,
list,
dict,
tuple,
]
list, dict, and tuple are incomplete types. That means when I try to write a wrapper function around cursor.execute using that type as the type of a parameter sql_params_dict, pyright strict yells at me Type of parameter "sql_params_dict" is partially unknown.
I think this can easily be fixed. My guess is, this could simply be a recursive type definition, and those last three lines could be changed to
list[TAllowedParameterValue],
dict[TAllowedParameterValue, TAllowedParameterValue],
tuple[TAllowedParameterValue, ...]
]
However, there may be more or fewer restrictions on those types. I didn't look into it very hard.
- 主要言語
- Python
- スター
- 233
- フォーク
- 152
- 平均マージ
- 21時間 5分
- マージ済み PR(30日)
- 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
databricks/databricks-sql-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
databricks/databricks-sql-python の issue をすべて見る
似ている issue
-
fix: inaccuracy ⚠️
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
uabrc/uabrc.github.io#1255 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ethereum-optimism/factory#64 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
duckdb/duckdb-python#627 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
Qiskit/qiskit-addon-sqd#376 ·