Skip to content

Comments

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

Merged
binste merged 6 commits intovega:mainfrom
dangotbanned:gen-const-literals
Aug 15, 2024
Merged

feat(typing): Generate Literal(s) using "const"#3538
binste merged 6 commits intovega:mainfrom
dangotbanned:gen-const-literals

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 dangotbanned requested a review from binste August 15, 2024 13:36
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
@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