Skip to content
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

Add missing arguments to Parameter and add type hints #3173

Merged
merged 3 commits into from
Sep 21, 2023

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
10 checks passed
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