Skip to content

Restore model defaults on inserts after the switch to COPY - #157

Merged
monodera merged 6 commits into
mainfrom
tickets/OBSPROC-144
Oct 13, 2026
Merged

monodera merged 6 commits into
mainfrom
tickets/OBSPROC-144

Conversation

@monodera

@monodera monodera commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Since #156, inserts go through COPY, which never sees the models' client-side default= values. Columns missing from the input are stored as NULL, and inputs without target.single_exptime (NOT NULL) fail outright.

Changes

  • TargetDB.insert() adds the columns missing from the input, set to their model default. This restores the pre-COPY behaviour for all callers.
  • CLI inserts also replace NaN / None / pd.NA / "" with the default, except in columns whose default is "".
  • Updates never fill in defaults.

Testing

uv run pytest tests: 108 passed, 1 skipped (the existing skip in test_clustering.py), including the Docker integration tests. The new integration test reads back what COPY stored. Against main, it fails on the single_exptime NOT NULL violation.

🤖 Generated with Claude Code

monodera and others added 6 commits October 13, 2026 15:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CzQgrukduKz6DPZrKfr3Rb
…e default

An all-null float64 column (a string or bool default) or a nullable Int64
column (parallax's 1e-7) refused the default: a FutureWarning on pandas 2,
a TypeError on pandas 3, and a TypeError for Int64 on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CzQgrukduKz6DPZrKfr3Rb
@monodera
monodera merged commit 87438d8 into main Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant