Fix Python client dropping external catalog subtype fields during deserialization (#5409) - #5457
Open
SHIVANSH-ux-ys wants to merge 1 commit into
Conversation
…alization (apache#5409) Move properties of IcebergRestConnectionConfigInfo, HadoopConnectionConfigInfo, and HiveConnectionConfigInfo inside an object schema within allOf in spec/polaris-management-service.yml so openapi-generator maps subtype fields correctly. Regenerate management client SDK models and add unit test. Signed-off-by: SHIVANSH-ux-ys <singaser78@gmail.com>
jbonofre
reviewed
Sep 8, 2026
| this is specified as the 'warehouse' when multiple logical catalogs are served under the same base | ||
| uri, and often translates into a 'prefix' added to all REST resource paths | ||
| - type: object | ||
| properties: |
Member
There was a problem hiding this comment.
This fix (nesting properties inside a second allOf object) is correct, but I believe the same issue exists in:
OAuthClientCredentialsParametersfortokenUri/clientId/clientSecret/scopesBearerAuthenticationParametersforbearerTokenSigV4AuthenticationParametersforroleArn/signingRegionAwsIamServiceIdentityInfoforiamArn
AuthenticationParameters and ServiceIdentityInfo are discriminated the same way as ConnectionConfigInfo, so these will hit the exact bug. Maybe worth fixing in this PR.
| # under the License. | ||
| # | ||
|
|
||
| from apache_polaris.sdk.management import ( |
Member
There was a problem hiding this comment.
These tests cover the 3 ConnectionConfigInfo subtypes fixed in this PR.
As mentioned earlier, as AuthenticationParameters/ServiceIdentityInfo share the same pattern and have the issue, we could add the corresponding tests for these ones as well.
Contributor
|
Maybe I missed something here but I thought we already have a PR for this: #5410 |
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.
Rationale for this change
Fixes #5409.
When deserializing
ConnectionConfigInfosubclasses in the Python client SDK (IcebergRestConnectionConfigInfo,HadoopConnectionConfigInfo,HiveConnectionConfigInfo), OpenAPI Generator's Python discriminator mapper drops subtype-specific properties (remoteCatalogName,warehouse) if they are declared as sibling properties alongsideallOfinstead of inside an object schema withinallOf.What changes are included in this PR?
spec/polaris-management-service.ymlto nest subtype properties inside a second- type: objectblock underallOfforIcebergRestConnectionConfigInfo,HadoopConnectionConfigInfo, andHiveConnectionConfigInfo(matching existingAwsStorageConfigInfopattern).remote_catalog_nameandwarehouseare generated as top-level fields on the respective models.client/python/tests/test_connection_config_deserialization.pyverifying deserialization of external catalog subtype fields.Are these changes tested?
Yes. Added unit test in
client/python/tests/test_connection_config_deserialization.pyand verified all 202 Python unit tests pass cleanly (uv run pytest tests/).