-
Notifications
You must be signed in to change notification settings - Fork 266
Update-schema: Add support for initial-default
#1770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Fokko
wants to merge
13
commits into
apache:main
Choose a base branch
from
Fokko:fd-add-initial-default-to-update-schema
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
ed357e5
to
388580a
Compare
Fokko
commented
Mar 11, 2025
sungwy
reviewed
Mar 15, 2025
@Fokko the PR looks good to me: I think we may just have missed including the new properties in the |
This was referenced Mar 20, 2025
…nitial-default-to-update-schema
…nitial-default-to-update-schema
Fokko
added a commit
to Fokko/iceberg-python
that referenced
this pull request
Mar 25, 2025
Right now we deserialize the JSON into a dict, which is then passed into the Pydantic model. It is better to fully delegate this to pydantic because it is probably faster, and we can detect when models are created from json or from Python dicts. Required by apache#1770
Fokko
added a commit
that referenced
this pull request
Mar 25, 2025
# Rationale for this change Right now we deserialize the JSON into a dict, which is then passed into the Pydantic model. It is better to fully delegate this to pydantic because it is probably faster, and we can detect when models are created from json or from Python dicts. Required by #1770 This is also a recommendation by Pydantic itself: https://docs.pydantic.dev/latest/concepts/performance/#in-general-use-model_validate_json-not-model_validatejsonloads # Are these changes tested? Existing tests # Are there any user-facing changes? No <!-- In the case of user-facing changes, please add the changelog label. -->
…nitial-default-to-update-schema
…nitial-default-to-update-schema
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
This allows for V3 initial defaults.
This PR took a bit longer than anticipated, mostly because the Pydantic json deserialization. There is a certain way we need to serialize python types to JSON single value encoding.
Are these changes tested?
Added new tests
Are there any user-facing changes?
After this PRs initial defaults can be set through the API. This enables users to add required fields.