Skip to content

Commit

Permalink
Merge branch 'main' into improve-agg-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned authored Jan 3, 2025
2 parents 7f66e23 + be5e9ec commit 78a07db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions tools/generate_schema_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,8 @@ def generate_vegalite_schema_wrapper(fp: Path, /) -> ModuleDef[str]:
all_ = [*sorted(it), "Root", "VegaLiteSchema", "SchemaBase", "load_schema"]
contents = [
HEADER,
"from typing import Any, Literal, Union, Protocol, Sequence, List, Iterator, TYPE_CHECKING",
"from collections.abc import Iterator, Sequence",
"from typing import Any, Literal, Union, Protocol, TYPE_CHECKING",
"import pkgutil",
"import json\n",
"import narwhals.stable.v1 as nw\n",
Expand Down Expand Up @@ -871,7 +872,8 @@ def generate_vegalite_channel_wrappers(fp: Path, /) -> ModuleDef[list[str]]:
all_ = sorted(chain(it, COMPAT_EXPORTS))
imports = [
"import sys",
"from typing import Any, overload, Sequence, List, Literal, Union, TYPE_CHECKING, TypedDict",
"from collections.abc import Sequence",
"from typing import Any, overload, Literal, Union, TYPE_CHECKING, TypedDict",
import_typing_extensions((3, 10), "TypeAlias"),
"import narwhals.stable.v1 as nw",
"from altair.utils.schemapi import Undefined, with_property_setters",
Expand Down Expand Up @@ -1226,7 +1228,8 @@ def vegalite_main(skip_download: bool = False) -> None:
fp_mixins = schemapath / "mixins.py"
print(f"Generating\n {schemafile!s}\n ->{fp_mixins!s}")
mixins_imports = (
"from typing import Any, Sequence, List, Literal, Union",
"from collections.abc import Sequence",
"from typing import Any, Literal, Union",
"from altair.utils import use_signature, Undefined, SchemaBase",
"from . import core",
)
Expand Down Expand Up @@ -1256,7 +1259,8 @@ def vegalite_main(skip_download: bool = False) -> None:
fp_theme_config: Path = schemapath / "_config.py"
content_theme_config = [
HEADER,
"from typing import Any, TYPE_CHECKING, Literal, Sequence, TypedDict, Union",
"from collections.abc import Sequence",
"from typing import Any, TYPE_CHECKING, Literal, TypedDict, Union",
import_typing_extensions((3, 14), "TypedDict", include_sys=True),
f"from ._typing import {ROW_COL_KWDS}, {PADDING_KWDS}",
"\n\n",
Expand Down
3 changes: 2 additions & 1 deletion tools/schemapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def __init__(self, fmt: str = "{}_T") -> None:
"from __future__ import annotations\n",
"import sys",
"from datetime import date, datetime",
"from typing import Annotated, Any, Generic, Literal, Mapping, TypeVar, Sequence, Union, get_args",
"from collections.abc import Sequence, Mapping",
"from typing import Annotated, Any, Generic, Literal, TypeVar, Union, get_args",
"import re",
import_typing_extensions(
(3, 14), "TypedDict", reason="https://peps.python.org/pep-0728/"
Expand Down

0 comments on commit 78a07db

Please sign in to comment.