Skip to content

Nulls and load_table #109

Description

@kelle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions