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

feat(typing): Generate Literal(s) using "const" #3538

Merged
merged 6 commits into from
Aug 15, 2024

Conversation

dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Aug 15, 2024

Description

Like #3535, this was another discovery while working through issues in #3536.
Split into another PR as this alters existing generated code.

The core change here is using Literal for both (JSON) properties "enum" and "const".

In python's type system, there is no need to distinguish between the two as Literal can represent one or more values.

@dangotbanned dangotbanned changed the title feat(typing): Generate Literal(s) using "const" feat(typing): Generate Literal(s) using "const" Aug 15, 2024
dangotbanned added a commit to dangotbanned/altair that referenced this pull request Aug 15, 2024
Still need the changes here prior to that merging. It solves issues in `_config.py` as well.
vega#3538
Copy link
Contributor

@binste binste left a comment

Choose a reason for hiding this comment

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

Nice! :) Always fascinating to see what changes in the autogenerated code based on changes in tools.

@binste binste merged commit fa3c4c5 into vega:main Aug 15, 2024
13 checks passed
@dangotbanned dangotbanned deleted the gen-const-literals branch August 17, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants