Skip to content

PNE-9739: Map the missing ingestion error types - #1070

Merged
pacdaemon merged 2 commits into
mainfrom
PNE-9739-ingestion-error-types
Nov 13, 2026
Merged

pacdaemon merged 2 commits into
mainfrom
PNE-9739-ingestion-error-types

Conversation

@pacdaemon

@pacdaemon pacdaemon commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Citrine Python PR

Description

Ticket: PNE-9739

The SDK raises ValueError while deserializing an ingestion status whose error_type it doesn't know, so the server's error message never reaches the user. IngestionErrorType was last synced with TblSvc in 2024 and is missing 11 of the server's 32 values. This PR adds them, including mixed_amount_and_ingredient from platform-backend#6689 (merged). The SDK enum now matches the server's IngestionErrorType and ingestion-openapi.yaml.

Each sync has appended its new members after the existing ones, in the server's declaration order. The new members follow that rule. Version bumped 5.2.0 → 5.2.1.

Testing

A new parametrized test builds an IngestionStatus from each of the 11 wire values. All 11 cases fail with ValueError on main and pass with this change. The full suite passes at 100% coverage, and flake8 is clean.

PR Type:

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance (non-breaking change to assist developers)

Adherence to team decisions

  • I have added tests for 100% coverage
  • I have written Numpy-style docstrings for every method and class.
  • I have communicated the downstream consequences of the PR to others.
  • I have bumped the version in __version__.py

🤖 Generated with Claude Code

@pacdaemon pacdaemon mentioned this pull request Nov 10, 2026
4 of 8 tasks
@pacdaemon
pacdaemon added this pull request to stack #1072 November 11, 2026 09:54
@pacdaemon
pacdaemon marked this pull request as ready for review November 11, 2026 09:56
@pacdaemon
pacdaemon requested a review from a team as a code owner November 11, 2026 09:56
Comment thread src/citrine/__version__.py Outdated
@@ -1 +1 @@
__version__ = "5.2.0"
__version__ = "5.2.1"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is an API break. Given the precedent that's been set previously, we don't need to make it a major version bump, but it should be a minor one. Additionally, please communicate this change to the customer team.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just updated the minor as suggested, however this is not an API break change, code wrote with 5.2.0 will work here. This will prevent an ingestion to crash when one of the errors synced here occurs. It could be good for customer to know that now it will not crash under those errors. Btw, this is a PR stack, if you have a few mins and you want to take a look at #1071, that last piece will allow the sdk to be more forgiveness with missing mappings.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

API break was the wrong term. It's a breaking behavior change as they can no longer handle these errors by catching a ValueErrror, and the follow-on PR will mean no unknown types can be caught that way. So someone upgrading may need to change their scripts.

Regardless, yes, I'll take a look at the follow-on, too.

@anoto-moniz anoto-moniz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for giving the customer team a heads up!

@pacdaemon
pacdaemon merged commit 6f342ec into main Nov 13, 2026
38 checks passed
@pacdaemon
pacdaemon deleted the PNE-9739-ingestion-error-types branch November 13, 2026 15:35
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.

2 participants