Add warning for write side with dynamic_schema override at api usage#3064
Draft
phoebusm wants to merge 1 commit into
Draft
Add warning for write side with dynamic_schema override at api usage#3064phoebusm wants to merge 1 commit into
phoebusm wants to merge 1 commit into
Conversation
Comment on lines
+1148
to
1153
| log.warning( | ||
| "update() received 'dynamic_schema' parameter which overrides the library setting " | ||
| "and may cause data corruption. Please remove it from the call site. " | ||
| "Support for this parameter override is scheduled to be removed in June 2026." | ||
| ) | ||
|
|
Contributor
There was a problem hiding this comment.
For a scheduled removal, the standard Python convention is warnings.warn() with DeprecationWarning (or FutureWarning for user-facing removals) rather than log.warning(). The latter goes to the logging system, so:
- Test suites using
pytest.warns(DeprecationWarning)orwarnings.filterwarnings("error", ...)won't catch it - The traceback points into this function rather than the caller, making it hard for users to locate the offending call site (
stacklevel=2fixes this)
Suggested change
| log.warning( | |
| "update() received 'dynamic_schema' parameter which overrides the library setting " | |
| "and may cause data corruption. Please remove it from the call site. " | |
| "Support for this parameter override is scheduled to be removed in June 2026." | |
| ) | |
| if "dynamic_schema" in kwargs: | |
| import warnings | |
| warnings.warn( | |
| "Passing 'dynamic_schema' directly to update() overrides the library setting " | |
| "and may cause data corruption. Please use LibraryOptions(dynamic_schema=...) " | |
| "when creating the library instead. " | |
| "Support for this parameter override is scheduled to be removed in June 2026.", | |
| FutureWarning, | |
| stacklevel=2, | |
| ) |
Contributor
ArcticDB Code Review SummaryAPI & Compatibility
Memory & Safety
Correctness
Code Quality
Testing
Build & Dependencies
Security
PR Title & Description
Documentation
|
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.
Reference Issues/PRs
https://man312219.monday.com/boards/7852509418/pulses/18372990857
dynamic_schemais a library option as it needs to be aligned at both read and write side, or the symbol may get corrupted. Therefore, this parameter in any write needs to be removed.As someone could have been using this combination, warning is added only at this PR to advise users to get rid of such api call.
The parameter is scheduled to be removed next month.
What does this implement or fix?
Any other comments?
Checklist
Checklist for code changes...