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

refactor: Simplify channels.py overloads #3659

Merged
merged 34 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bdb2423
refactor: Simplify some unreachable code
dangotbanned Oct 25, 2024
2d2b6bd
refactor: Start aligning branch with `to_type_repr`
dangotbanned Oct 25, 2024
e889e91
refactor: Continue aligning
dangotbanned Oct 25, 2024
d35c371
feat: Adds flattenable guards to `SchemaInfo`
dangotbanned Oct 26, 2024
7717392
feat: Adds `SchemaInfo.to_type_repr_batched`
dangotbanned Oct 26, 2024
ab1f784
feat: Adds `Grouped` utility
dangotbanned Oct 26, 2024
65c91d8
refactor: Make `haspropsetters` a `ClassVar`
dangotbanned Oct 26, 2024
3ab79c3
feat: Reimplement `@overload`(s)
dangotbanned Oct 26, 2024
90db629
feat(typing): Include `Temporal` alias in `channels` annotations
dangotbanned Oct 26, 2024
926e863
build: run `generate-schema-wrapper`
dangotbanned Oct 26, 2024
d392076
refactor: Remove unneeded break between overloads
dangotbanned Oct 26, 2024
f8ef9aa
refactor: Use a context manager for temp remapping
dangotbanned Oct 26, 2024
1f0b012
Merge remote-tracking branch 'upstream/main' into property-setters-redux
dangotbanned Oct 26, 2024
1a39019
test(typing): Adds `test_channels_typing`
dangotbanned Oct 27, 2024
191a68c
Merge remote-tracking branch 'upstream/main' into property-setters-redux
dangotbanned Oct 27, 2024
898142b
feat: Generate positional/keyword only overloads
dangotbanned Oct 27, 2024
a873896
test: Update `test_channels_typing`
dangotbanned Oct 27, 2024
c6f0df8
chore(typing): Add ignore comments on questionable examples
dangotbanned Oct 27, 2024
745c2d8
fix(typing): Be more explicit for `mypy`
dangotbanned Oct 27, 2024
0a26f27
docs(DRAFT): Rewrite `us_population_pyramid_over_time` to fix warning
dangotbanned Oct 28, 2024
5a72c43
docs: Add doc to `Grouped`, rename `falsey` -> `falsy`
dangotbanned Oct 28, 2024
3f8596d
refactor: Simplify and add doc to `SchemaInfo.is_primitive`
dangotbanned Oct 28, 2024
c8a7fbe
docs: Improve `is_literal`, `is_flattenable`, `is_union_flattenable`
dangotbanned Oct 28, 2024
59533f6
docs: Finish `SchemaInfo.to_type_repr_batched`
dangotbanned Oct 28, 2024
af02bf7
docs: Finish `RemapContext`
dangotbanned Oct 28, 2024
971b39f
docs: Add docs for new `SchemaGenerator` methods
dangotbanned Oct 28, 2024
30ed656
refactor: Factor-out `yield/return` exit
dangotbanned Oct 28, 2024
426bc29
revert: (https://github.com/vega/altair/pull/3659/commits/0a26f276e4d…
dangotbanned Oct 29, 2024
195d086
feat(typing): Extend positional-only `@overload` to support reuse
dangotbanned Oct 29, 2024
f59ae1b
refactor(typing): Update `channels` typing imports
dangotbanned Oct 29, 2024
7a426ec
feat(typing): Use `api.py` aliases in `@overload`
dangotbanned Oct 29, 2024
9005ed2
build: run `generate-schema-wrapper`
dangotbanned Oct 29, 2024
8ca7ae0
chore(typing): Remove now-unused type ignores
dangotbanned Oct 29, 2024
9cf9458
docs: Update `SchemaGenerator.overload_dispatch`
dangotbanned Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 0 additions & 107 deletions altair/vegalite/v5/schema/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
"Interpolate_T",
"LayoutAlign_T",
"LegendOrient_T",
"LocalMultiTimeUnit_T",
"LocalSingleTimeUnit_T",
"Map",
"MarkInvalidDataMode_T",
"MarkType_T",
Expand All @@ -80,7 +78,6 @@
"SelectionType_T",
"SingleDefUnitChannel_T",
"SingleTimeUnit_T",
"SortByChannelDesc_T",
"SortByChannel_T",
"SortOrder_T",
"StackOffset_T",
Expand All @@ -97,8 +94,6 @@
"TitleOrient_T",
"TypeForShape_T",
"Type_T",
"UtcMultiTimeUnit_T",
"UtcSingleTimeUnit_T",
"Value",
"VegaThemes",
"WindowOnlyOp_T",
Expand Down Expand Up @@ -886,50 +881,6 @@ class PaddingKwds(TypedDict, total=False):
"bottom-left",
"bottom-right",
]
LocalMultiTimeUnit_T: TypeAlias = Literal[
"yearquarter",
"yearquartermonth",
"yearmonth",
"yearmonthdate",
"yearmonthdatehours",
"yearmonthdatehoursminutes",
"yearmonthdatehoursminutesseconds",
"yearweek",
"yearweekday",
"yearweekdayhours",
"yearweekdayhoursminutes",
"yearweekdayhoursminutesseconds",
"yeardayofyear",
"quartermonth",
"monthdate",
"monthdatehours",
"monthdatehoursminutes",
"monthdatehoursminutesseconds",
"weekday",
"weekdayhours",
"weekdayhoursminutes",
"weekdayhoursminutesseconds",
"dayhours",
"dayhoursminutes",
"dayhoursminutesseconds",
"hoursminutes",
"hoursminutesseconds",
"minutesseconds",
"secondsmilliseconds",
]
LocalSingleTimeUnit_T: TypeAlias = Literal[
"year",
"quarter",
"month",
"week",
"day",
"dayofyear",
"date",
"hours",
"minutes",
"seconds",
"milliseconds",
]
MarkInvalidDataMode_T: TypeAlias = Literal[
"filter",
"break-paths-filter-domains",
Expand Down Expand Up @@ -1155,20 +1106,6 @@ class PaddingKwds(TypedDict, total=False):
"utcseconds",
"utcmilliseconds",
]
SortByChannelDesc_T: TypeAlias = Literal[
"-x",
"-y",
"-color",
"-fill",
"-stroke",
"-strokeWidth",
"-size",
"-shape",
"-fillOpacity",
"-strokeOpacity",
"-opacity",
"-text",
]
SortByChannel_T: TypeAlias = Literal[
"x",
"y",
Expand Down Expand Up @@ -1201,50 +1138,6 @@ class PaddingKwds(TypedDict, total=False):
TitleOrient_T: TypeAlias = Literal["none", "left", "right", "top", "bottom"]
TypeForShape_T: TypeAlias = Literal["nominal", "ordinal", "geojson"]
Type_T: TypeAlias = Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"]
UtcMultiTimeUnit_T: TypeAlias = Literal[
"utcyearquarter",
"utcyearquartermonth",
"utcyearmonth",
"utcyearmonthdate",
"utcyearmonthdatehours",
"utcyearmonthdatehoursminutes",
"utcyearmonthdatehoursminutesseconds",
"utcyearweek",
"utcyearweekday",
"utcyearweekdayhours",
"utcyearweekdayhoursminutes",
"utcyearweekdayhoursminutesseconds",
"utcyeardayofyear",
"utcquartermonth",
"utcmonthdate",
"utcmonthdatehours",
"utcmonthdatehoursminutes",
"utcmonthdatehoursminutesseconds",
"utcweekday",
"utcweekdayhours",
"utcweekdayhoursminutes",
"utcweekdayhoursminutesseconds",
"utcdayhours",
"utcdayhoursminutes",
"utcdayhoursminutesseconds",
"utchoursminutes",
"utchoursminutesseconds",
"utcminutesseconds",
"utcsecondsmilliseconds",
]
UtcSingleTimeUnit_T: TypeAlias = Literal[
"utcyear",
"utcquarter",
"utcmonth",
"utcweek",
"utcday",
"utcdayofyear",
"utcdate",
"utchours",
"utcminutes",
"utcseconds",
"utcmilliseconds",
]
WindowOnlyOp_T: TypeAlias = Literal[
"row_number",
"rank",
Expand Down
Loading