Skip to content

Commit

Permalink
set defaults of Optional taxon fields to None otherwise it doesn't wo…
Browse files Browse the repository at this point in the history
…rk without Pandera
  • Loading branch information
chrisAta committed Jan 9, 2025
1 parent 1284239 commit b15531c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions mgnify_pipelines_toolkit/schemas/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b15531c

Please sign in to comment.