Skip to content

Commit

Permalink
feat(typing): Generate Literal aliases in channels overload(s) (#…
Browse files Browse the repository at this point in the history
…3535)

* feat(typing): Reuse `Literal`(s) in `channels` overloads

* build: run `generate-schema-wrapper`
  • Loading branch information
dangotbanned authored Aug 13, 2024
1 parent b996fa4 commit cfab660
Show file tree
Hide file tree
Showing 3 changed files with 507 additions and 6,257 deletions.
107 changes: 107 additions & 0 deletions altair/vegalite/v5/schema/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"Interpolate_T",
"LayoutAlign_T",
"LegendOrient_T",
"LocalMultiTimeUnit_T",
"LocalSingleTimeUnit_T",
"Map",
"MarkInvalidDataMode_T",
"MarkType_T",
Expand All @@ -43,6 +45,7 @@
"SelectionType_T",
"SingleDefUnitChannel_T",
"SingleTimeUnit_T",
"SortByChannelDesc_T",
"SortByChannel_T",
"SortOrder_T",
"StackOffset_T",
Expand All @@ -56,6 +59,8 @@
"TitleOrient_T",
"TypeForShape_T",
"Type_T",
"UtcMultiTimeUnit_T",
"UtcSingleTimeUnit_T",
"VegaThemes",
"WindowOnlyOp_T",
]
Expand Down Expand Up @@ -757,6 +762,50 @@ def func(
"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 @@ -982,6 +1031,20 @@ def func(
"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 @@ -1010,6 +1073,50 @@ def func(
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

0 comments on commit cfab660

Please sign in to comment.