Skip to content

Conversation

@csm-thu
Copy link
Member

@csm-thu csm-thu commented Mar 4, 2024

Prior to this commit, a call to find_dataset_by_id on a dataset created with v2 of the Cosmo Tech API raised this error:

  cosmotech_api.exceptions.ApiValueError: Invalid value for
  `ingestion_status` (None), must be one of ['NONE', 'PENDING', 'ERROR',
  'SUCCESS']

or a similar error for twincacheStatus. This is because "legacy" datasets have null values for these attributes (and for the attribute sourceType, but this one has None explicitly allowed in the enum values).

To fix this error, this commit adds nullable: true for the attributes ingestionStatus and twincacheStatus in the openapi.yaml file.

Prior to this commit, a call to find_dataset_by_id on a dataset created
with v2 of the Cosmo Tech API raised this error:
  cosmotech_api.exceptions.ApiValueError: Invalid value for
  `ingestion_status` (None), must be one of ['NONE', 'PENDING', 'ERROR',
  'SUCCESS']
or a similar error for twincacheStatus. This is because "legacy" datasets
have null values for these attributes (and for the attribute 'sourceType',
but this one has 'None' explicitly allowed in the enum values).

To fix this error, this commit adds "nullable: true" for the attributes
ingestionStatus and twincacheStatus in the openapi.yaml file.
@csm-thu csm-thu requested a review from jreynard-code March 4, 2024 15:08
Copy link
Member

@jreynard-code jreynard-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@csm-thu csm-thu merged commit 63f21c0 into main Mar 4, 2024
@csm-thu csm-thu deleted the THU/fix_python_client_error_on_null_fields_in_legacy_datasets branch March 4, 2024 15:46
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.

3 participants