Allow and prefer non-prefixed extra fields for dataprep hook#27039
Merged
potiuk merged 3 commits intoapache:mainfrom Oct 28, 2022
Merged
Allow and prefer non-prefixed extra fields for dataprep hook#27039potiuk merged 3 commits intoapache:mainfrom
potiuk merged 3 commits intoapache:mainfrom
Conversation
ferruzzi
approved these changes
Oct 20, 2022
Contributor
ferruzzi
left a comment
There was a problem hiding this comment.
Left a non-blocking suggestion, otherwise LGTM
Comment on lines
34
to
35
Contributor
There was a problem hiding this comment.
Suggested change
| backcompat_prefix = "extra__dataprep__" | |
| if field_name.startswith('extra_'): | |
| backcompat_prefix = "extra__dataprep__" | |
| if field_name.startswith(backcompat_prefix): |
From 2.3 we no longer need this convention for web UI custom fields. Just cleaning up the codebase to generally not use this pattern.
32c7980 to
26e45e2
Compare
ferruzzi
reviewed
Oct 24, 2022
Contributor
ferruzzi
left a comment
There was a problem hiding this comment.
Left a comment. If there is a good reason for the lack of standardization, then carry on. Otherwise I'd prefer (non-blocking) to see consistency when possible.
| def _get_field(extras: dict, field_name: str): | ||
| """Get field from extra, first checking short name, then for backcompat we check for prefixed name.""" | ||
| backcompat_prefix = "extra__dataprep__" | ||
| if field_name.startswith("extra_"): |
Contributor
There was a problem hiding this comment.
In some of these PRs you are using "extra_", some use "extra__" (two underscores), and others are using backcompat_prefix.
Contributor
Author
There was a problem hiding this comment.
No reason just someone suggested adding double underscore and I simply didn't get to all of them... I can do a cleanup pr after all the dust is settled
dstandish
commented
Oct 24, 2022
potiuk
approved these changes
Oct 28, 2022
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.
From 2.3 we no longer need this convention for web UI custom fields. Just cleaning up the codebase to generally not use this pattern.