Skip to content

Comments

Add missing arguments to Parameter and add type hints#3173

Merged
binste merged 3 commits intovega:mainfrom
binste:add_missing_arguments_to_parameter
Sep 21, 2023
Merged

Add missing arguments to Parameter and add type hints#3173
binste merged 3 commits intovega:mainfrom
binste:add_missing_arguments_to_parameter

Conversation

@binste
Copy link
Contributor

@binste binste commented Aug 28, 2023

I noticed in #3143 that alt.param sets some attributes on alt.Parameter which do not exist on that class when its initialised. That's a problem for mypy as all attributes should exist from the beginning. This PR adds empty, param, and param_type and type hints for the whole class.

I tested with the Interval examples from the docs to make sure that indeed empty=Undefined leads to empty not being present in the final chart dict which is the old behaviour when empty was not present on the parameter instance at all if it was not defined.

@binste binste mentioned this pull request Aug 27, 2023
8 tasks
Copy link
Contributor

@joelostblom joelostblom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @binste ! I am not very familiar with type but this looks harmless, so approving to avoid it going stale. Feel free to merge.

@binste
Copy link
Contributor Author

binste commented Sep 21, 2023

Thanks @joelostblom :)

@binste binste merged commit adc6550 into vega:main Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants