Skip to content

v2: reject empty condition and experiment IDs - #629

Open
dweindl wants to merge 3 commits into
PEtab-dev:mainfrom
dweindl:v2-empty-condition-id
Open

dweindl wants to merge 3 commits into
PEtab-dev:mainfrom
dweindl:v2-empty-condition-id

Conversation

@dweindl

@dweindl dweindl commented Nov 25, 2026

Copy link
Copy Markdown
Member

Stacked on #610; only the last commit is new here.

Rows with an empty conditionId in the condition table or an empty experimentId in the experiment table were silently dropped by groupby in ConditionTable.from_df and ExperimentTable.from_df, so neither loading nor linting reported them. They now raise EmptyIdError, naming the table and the file, followed by the affected rows (at most 10), e.g.:

ConditionTable has 1 row(s) with empty conditionId. File: .../conditions.tsv
conditionId           targetId  targetValue
        NaN not_a_model_entity         42.0

TableError is the new common base class of EmptyIdError and MissingColumnsError. petablint reports any TableError without a traceback.

🤖 Generated with Claude Code

dweindl and others added 2 commits November 18, 2026 13:53
Creating v2 tables from DataFrames or TSV files now raises
`MissingColumnsError` if required columns are missing, naming the table,
the missing columns, and the file. Previously, this resulted in
unspecific pydantic errors or `KeyError`s, or was silently accepted
(e.g., a missing `estimate` column defaulted to `True`). `petablint`
reports this error without a traceback.

`BaseTable.from_df` now handles `None`/empty input, moves named index
levels to columns, and checks required columns before delegating to the
new abstract `_from_df`. The sciml `HybridizationTable` gets the same
check.

Relates to PEtab-dev#369.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.04651% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.33%. Comparing base (d21ee3b) to head (ef7cff1).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
petab/petablint.py 0.00% 4 Missing ⚠️
petab/v2/core.py 94.59% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #629      +/-   ##
==========================================
+ Coverage   80.18%   80.33%   +0.15%     
==========================================
  Files          70       70              
  Lines        8442     8463      +21     
  Branches     1544     1544              
==========================================
+ Hits         6769     6799      +30     
+ Misses       1182     1177       -5     
+ Partials      491      487       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Rows with an empty `conditionId` in the condition table or an empty
`experimentId` in the experiment table were silently dropped by
`groupby` in `ConditionTable.from_df` and `ExperimentTable.from_df`,
so neither loading nor linting reported them. Raise an `EmptyIdError`
instead, naming the table, the rows, and the file.

Add `TableError` as common base class of `EmptyIdError` and
`MissingColumnsError`, and report it in `petablint` without a
traceback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl force-pushed the v2-empty-condition-id branch from f10d96d to ef7cff1 Compare November 25, 2026 15:34
@dweindl
dweindl marked this pull request as ready for review November 25, 2026 15:38
@dweindl
dweindl requested a review from a team as a code owner November 25, 2026 15:38
@dweindl dweindl self-assigned this Nov 25, 2026

This branch has not been deployed

No deployments
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.

2 participants