-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…3653) * feat: Support `datetime.(date|datetime)` as a `SchemaBase` parameter #3651 * test: Adds `test_to_dict_datetime` * feat: Reject non-UTC timezones The [vega-lite docs](https://vega.github.io/vega-lite/docs/datetime.html) don't mention the `utc` property - but this restricts us to `utc` or `None` * test(typing): Adds `test_to_dict_datetime_typing` Annotation support will be complete once `mypy` starts complaining that these comments are unused * fix(typing): Remove unused ignore https://github.com/vega/altair/actions/runs/11460348337/job/31886851940?pr=3653 * feat(typing): Adds `Temporal` alias * build: run `generate-schema-wrapper` **Expecting to fail `mypy`** #3653 (comment) * fix(typing): Remove unused ignores #3653 (comment), https://github.com/vega/altair/actions/runs/11461315861/job/31890019636?pr=3653 * fix: Use object identity for `utc` test instead of name Adds two tests with "fake" utc timezones * refactor(typing): Narrow `selection_(interval|point)(value=...)` types - Tentative - Copied from `core.SelectionParameter` * refactor(typing): Utilize `PrimitiveValue_T` #3656 * refactor(typing): Factor out `_LiteralValue` alias This was incomplete as it didn't include `None`, but was serving the same purpose as the generated alias * feat(typing): Accurately type `selection_(interval|point)(value=...)` Added some docs to the new types, since what they describe is somewhat complex References: - https://vega.github.io/vega-lite/docs/selection.html#current-limitations - https://vega.github.io/vega-lite/docs/param-value.html - https://vega.github.io/vega-lite/docs/selection.html#project - https://github.com/vega/altair/blob/5a6f70dc193f7ed9c89e6cc22e95c9d885167939/altair/vegalite/v5/schema/vega-lite-schema.json#L23087-L23118 Resolves: - #3653 (comment) - #3653 (comment) * test(typing): Add (failing) `test_selection_interval_value_typing` Need to fix this, but adding this first to demonstrate the issue. Currently the way I've typed it prevents using different types for each encoding. The goal is for each encoding to restrict types independently. E.g. here `x` is **only** `date`, `y` is **only** `float` * fix(typing): Correct failing `selection_interval` typing #3653 (comment) * test(typing): Improve coverage for `test_selection_interval_value_typing`
- Loading branch information
1 parent
5a6f70d
commit f57df00
Showing
10 changed files
with
747 additions
and
210 deletions.
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
Oops, something went wrong.