[MCC-1484891] Python Lib - Align publish/dry_publish results on canonical envelope - #56
Merged
ibaig-mdsol merged 4 commits intoAug 5, 2026
Conversation
…ical envelope Parse the canonical envelope the Arrow Flight server now emits (MCC-1533427) and expose it as metadata / metrics / checks / errors / invalid_records on both public results. - transport gains a single PublishEnvelope; DryPublishResponse and PublishResponse become aliases of it, so one wire type covers both calls - the 16 flat json_result.get() lookups collapse into PublishEnvelope.from_json, which degrades to defaults on missing sections rather than raising - flat fields (status, valid_record_count, no_of_columns, is_dataset_valid, …) are kept as properties reading through to the envelope, so existing notebooks and vignettes keep working with no duplicated state - publish_response_to_domain and dry_publish_response_to_domain share one _envelope_to_domain mapper - invalid_records still arrives on the Arrow IPC channel, not in the JSON Tests use envelopes captured verbatim from the Arrow server, so the SDK fails if it drifts from what the server actually emits.
… dry_publish output The batch number is an internal detail and should not appear when users print a publish or dry_publish result. Marking the field repr=False drops it from the printed output while leaving it on the object, so callers reading result.dataset_batch_number or result.metadata.dataset_batch_number keep working and no deprecation cycle is needed. Deliberately not removed from the API. Dropping a field that released clients already read is what caused MCC-1533427, and the ticket only requires that it stop being displayed. No Arrow change: the server still sends dataset_batch_number and the transport layer still parses it, so ResponseMetadata remains an honest mirror of the wire. Tests assert the field is absent from the repr across all three entry points (dry_publish failure, dry_publish success, publish) while remaining readable, plus a guard that the rest of the metadata section is still printed. Verified to fail without the change: 3 of 5 fail on revert.
butsyk-mdsol
previously approved these changes
Aug 4, 2026
dsilaghi-mdsol
force-pushed
the
feat/MCC-1484891-harmonize-publish-response-envelope
branch
from
August 4, 2026 15:41
9c6fff9 to
e49abc1
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Python SDK’s canonical publish/dry_publish result envelope so dataset_batch_number remains part of the public API but is no longer shown in the default printed representation (repr/str) of results and their metadata.
Changes:
- Hide
ResultMetadata.dataset_batch_numberfrom dataclassrepr()output viarepr=Falsewhile keeping the field accessible programmatically. - Add unit tests to assert
dataset_batch_numberis not present in printed output for publish and dry_publish results and that metadata still includes other expected fields. - Bump the package version to
1.1.0.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
dataconnect/models.py |
Marks dataset_batch_number as repr=False to hide it from printed output while preserving accessors. |
tests/test_publish_envelope.py |
Adds tests validating dataset_batch_number is omitted from repr() and that metadata remains readable/printed as expected. |
pyproject.toml |
Updates the library version to 1.1.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ibaig-mdsol
approved these changes
Aug 4, 2026
ibaig-mdsol
deleted the
feat/MCC-1484891-harmonize-publish-response-envelope
branch
August 5, 2026 06:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feature
Checklist
git commit --amend --no-editcommand to reduce commit messages when making small file changes (like changing linespacing).tests/folder.doc/folder.Changes Summary
Stop showing
dataset_batch_numberwhen aPublishResultorDryPublishResultis printed, without removing it from the API.ResultMetadata.dataset_batch_numberrepr=False.result.dataset_batch_numberandresult.metadata.dataset_batch_numberkeep working; only the printed representation changes.ResponseMetadatastays an honest mirror of the wire.repr()for dry_publish (pass and fail) and publish, that it's still readable via both accessors, and that the rest ofResultMetadatais still printed.Deployment Notes
None