astrodbtoolkit / astrodbtoolkit/AstrodbKit

Nulls and load_table

オープン
#109 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
12
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

説明

Feedback from https://github.com/wvining/MIRION_Database_v4/blob/main/workflow.md. I don't really understand this and am not sure if it needs fixing but FYI:

> Discovered and worked around an astrodbkit quirk: load_table calls .insert().values(data) unconditionally — for data == [] (an empty-array reference JSON file), SQLAlchemy's insert().values([]) inserts one all-default row rather than zero rows, which fails NOT NULL constraints. Fix: don't leave empty-array placeholder files for Publications/AssociationList/ParameterList/SourceTypeList — load_table only loads a lookup table if its JSON file exists at all, so deleting the file (rather than emptying it to []) skips the load cleanly. These will be (re)created for real once Phases 6-7 populate them.

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

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず workflow.md を読み、load_table のエントリーポイントを特定します。参照されている JSON ファイルが存在しない場合と、空の配列である場合の動作を比較します。空の配列を含む lookup ファイルは行を挿入せずにスキップすべきかを確認し、想定されるテストまたはドキュメントの更新を特定します。payload では実装ファイルもテストも指定されていません。

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

評価

技術スタック
python, sqlalchemy
領域
databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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