From 28ed729d2e3a10354a2cc62269dc02b0d4e20cd1 Mon Sep 17 00:00:00 2001 From: Michelle Wang Date: Mon, 15 Jul 2024 10:20:22 +0200 Subject: [PATCH] [FIX] Add `pipeline_starttime` to bagel file (#286) * test for model field names * add `pipeline_starttime` column to bagel --- nipoppy_cli/nipoppy/tabular/bagel.py | 4 ++++ nipoppy_cli/tests/test_tabular_bagel.py | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nipoppy_cli/nipoppy/tabular/bagel.py b/nipoppy_cli/nipoppy/tabular/bagel.py index 78ffe4a1..d80d9e99 100644 --- a/nipoppy_cli/nipoppy/tabular/bagel.py +++ b/nipoppy_cli/nipoppy/tabular/bagel.py @@ -50,6 +50,10 @@ class BagelModel(BaseTabularModel): pipeline_complete: str = Field( description="The status of the pipeline run for this participant-visit pair" ) + # this is needed for now for the dashboard for work, but should be removed + # if https://github.com/neurobagel/digest/issues/153 is addressed + # TODO discuss bagel schema + pipeline_starttime: str = Field(default="UNAVAILABLE") @field_validator("pipeline_complete") @classmethod diff --git a/nipoppy_cli/tests/test_tabular_bagel.py b/nipoppy_cli/tests/test_tabular_bagel.py index a82437ac..44b39f0d 100644 --- a/nipoppy_cli/tests/test_tabular_bagel.py +++ b/nipoppy_cli/tests/test_tabular_bagel.py @@ -27,7 +27,17 @@ ], ) def test_model(data): - BagelModel(**data) + bagel = BagelModel(**data) + assert set(bagel.model_fields.keys()) == { + Bagel.col_participant_id, + Bagel.col_bids_participant, + Bagel.col_session_id, + Bagel.col_pipeline_name, + Bagel.col_pipeline_version, + Bagel.col_pipeline_complete, + "session", + "pipeline_starttime", + } @pytest.mark.parametrize(