Skip to content

Conversation

@JR-1991
Copy link
Member

@JR-1991 JR-1991 commented Dec 8, 2025

This pull request refactors the ChEBI fetcher data models to be more robust against unexpected fields in the API response, as has been reported in #94, and simplifies their structure. It also introduces a new integration test for fetching ChEBI entries without a definition. The most important changes are grouped below:

Data Model Simplification and Robustness

  • Removed several fields and sub-models from the ChEBI-related data classes (ChEBIName, ChEBINames, ChEBIChemicalData, and many fields from ChEBIStructure, ChEBIEntryData, and ChEBIEntryResult), streamlining the models to only include fields used by the codebase.
  • Added model_config = ConfigDict(extra="ignore") to the main ChEBI data models (ChEBIStructure, ChEBIEntryData, ChEBIEntryResult, and ChebiSearchResult) to ignore any unexpected fields returned by the ChEBI API, making the fetcher more robust to upstream changes. [1] [2]
  • Cleaned up imports and reordered them for clarity in pyenzyme/fetcher/chebi.py.

Testing Improvements

  • Added a new integration test test_fetch_chebi_wo_defintion to ensure the fetcher can handle ChEBI entries that lack a definition.
  • Minor formatting improvement in the test file with an added blank line for readability.

This change is Reviewable

Updated ChEBI-related Pydantic models to use ConfigDict(extra="ignore") for better compatibility with API responses containing unexpected fields. Removed unused fields and simplified model definitions. Added an integration test for fetching ChEBI entries without a definition.
@JR-1991 JR-1991 self-assigned this Dec 8, 2025
@JR-1991 JR-1991 added the bug Something isn't working label Dec 8, 2025
@JR-1991 JR-1991 linked an issue Dec 8, 2025 that may be closed by this pull request
@JR-1991 JR-1991 added this to EnzymeML Dec 8, 2025
@JR-1991 JR-1991 merged commit 1c13e47 into main Dec 8, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this to Done in EnzymeML Dec 8, 2025
@JR-1991 JR-1991 deleted the 94-fetch-rhea-for-23-butanediol-dehydrogenase-fails branch December 8, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fetch Rhea for 2,3-butanediol dehydrogenase fails

2 participants