From b15531ccd7b8f3eb1cee820b79017109c2536c08 Mon Sep 17 00:00:00 2001 From: Christian Atallah <chrisata@ebi.ac.uk> Date: Thu, 9 Jan 2025 16:43:19 +0000 Subject: [PATCH] set defaults of Optional taxon fields to None otherwise it doesn't work without Pandera --- mgnify_pipelines_toolkit/schemas/schemas.py | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mgnify_pipelines_toolkit/schemas/schemas.py b/mgnify_pipelines_toolkit/schemas/schemas.py index 99d03d4..4e61a81 100644 --- a/mgnify_pipelines_toolkit/schemas/schemas.py +++ b/mgnify_pipelines_toolkit/schemas/schemas.py @@ -158,28 +158,28 @@ class Taxon(BaseModel): All of the ranks are optional, to model for the taxon being "Unclassified". """ - Superkingdom: Optional[TaxRank] - Kingdom: Optional[TaxRank] - Phylum: Optional[TaxRank] - Class: Optional[TaxRank] - Order: Optional[TaxRank] - Family: Optional[TaxRank] - Genus: Optional[TaxRank] - Species: Optional[TaxRank] + Superkingdom: Optional[TaxRank] = None + Kingdom: Optional[TaxRank] = None + Phylum: Optional[TaxRank] = None + Class: Optional[TaxRank] = None + Order: Optional[TaxRank] = None + Family: Optional[TaxRank] = None + Genus: Optional[TaxRank] = None + Species: Optional[TaxRank] = None class PR2Taxon(BaseModel): """Class for modelling the same thing as the preceding class, but for PR2 ranks.""" - Domain: Optional[TaxRank] - Supergroup: Optional[TaxRank] - Division: Optional[TaxRank] - Subdivision: Optional[TaxRank] - Class: Optional[TaxRank] - Order: Optional[TaxRank] - Family: Optional[TaxRank] - Genus: Optional[TaxRank] - Species: Optional[TaxRank] + Domain: Optional[TaxRank] = None + Supergroup: Optional[TaxRank] = None + Division: Optional[TaxRank] = None + Subdivision: Optional[TaxRank] = None + Class: Optional[TaxRank] = None + Order: Optional[TaxRank] = None + Family: Optional[TaxRank] = None + Genus: Optional[TaxRank] = None + Species: Optional[TaxRank] = None class TaxonRecord(Taxon):