-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BugFix] - Untyped variadic keyword arguments break during execution #6250
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
921abf2
fix: ensure var_kw args come last in signatures
montezdesousa 6657a9e
remove package builder change
montezdesousa 41befa7
Update package_builder.py
montezdesousa c932a1b
fix: warn only when ExtraParams
montezdesousa 8c1a67f
track VAR_KEYWORD
montezdesousa 1e0b4e8
minor fix
montezdesousa 248b1b3
type Any if no type provided
montezdesousa d8f5e5e
minor fix
montezdesousa 7726ff6
Merge branch 'develop' into bugfix/endpoint_kwargs
deeleeramone 182698f
fix test
montezdesousa 7ff02dd
fix: _as_dict
montezdesousa fc62740
ruff
montezdesousa da37bca
update reorder_params unit test
montezdesousa 5d42683
update func default and tests
montezdesousa 5c553cf
typing
montezdesousa db2bcf1
Merge branch 'develop' into bugfix/endpoint_kwargs
montezdesousa e800fb8
update comment
montezdesousa 7dfb22b
update comment
montezdesousa 01d5326
rename var
montezdesousa 6d49ae6
Update command_runner.py
montezdesousa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"kwargs" is being forced as a "required" field in the body, and calling it VAR_KEYWORD or VAR_POSITIONAL is not allowed with a default value.
Optional[Dict]
is not actually optional without a default state. Setting as POSITIONAL_OR_KEYWORD allows you to set a default value of {}, and **kwargs is still in the request body.It would be ideal if you didn't have to put kwargs in the body, but could just add them to the URL like every other parameter. This behaviour, though, is limited to the API. The Python interface does not require them to be declared within the field "kwargs".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to add undefined URL parameters to API endpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well then we can't get around that "nice to have" thing, but at least they can be unpacked the same as the Python interface.
This:
body = json.dumps({"data": data, "kwargs": {"chart_params": {"title": "my chart"}}})
When unpacked becomes the same as the Python Interface "extras":
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metadata reflects the call that was made to the api, if the call sends
'chart_params': {'title': 'my chart'}}
inside a parameter calledkwargs
/some_kw_args
/extra_params
it is expected that you seeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this purpose, "extra_params" is a better name for this than "kwargs". Less confusion with everything else that is passed around as "kwargs".