Skip to content

Commit c9f7613

Browse files
authored
Merge branch 'main' into perf-validation
2 parents 7656ab9 + 712680b commit c9f7613

File tree

18 files changed

+10121
-771
lines changed

18 files changed

+10121
-771
lines changed

altair/typing.py renamed to altair/typing/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@
4646
"ChartType",
4747
"EncodeKwds",
4848
"Optional",
49+
"ThemeConfig",
4950
"is_chart_type",
51+
"theme",
5052
]
5153

54+
from altair.typing import theme
55+
from altair.typing.theme import ThemeConfig
5256
from altair.utils.schemapi import Optional
5357
from altair.vegalite.v5.api import ChartType, is_chart_type
5458
from altair.vegalite.v5.schema.channels import (

altair/typing/theme.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from altair.vegalite.v5.schema._config import * # noqa: F403

altair/utils/core.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,21 @@ def decorate(cb: WrapsFunc[R], /) -> WrappedMethod[T, P, R] | WrappedFunc[P, R]:
770770
return decorate
771771

772772

773+
@overload
773774
def update_nested(
774775
original: t.MutableMapping[Any, Any],
775776
update: t.Mapping[Any, Any],
777+
copy: Literal[False] = ...,
778+
) -> t.MutableMapping[Any, Any]: ...
779+
@overload
780+
def update_nested(
781+
original: t.Mapping[Any, Any],
782+
update: t.Mapping[Any, Any],
783+
copy: Literal[True],
784+
) -> t.MutableMapping[Any, Any]: ...
785+
def update_nested(
786+
original: Any,
787+
update: t.Mapping[Any, Any],
776788
copy: bool = False,
777789
) -> t.MutableMapping[Any, Any]:
778790
"""

altair/utils/theme.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
from __future__ import annotations
44

55
import sys
6-
from typing import TYPE_CHECKING, Any, Dict
6+
from typing import TYPE_CHECKING
77

8-
from .plugin_registry import Plugin, PluginRegistry
8+
from altair.utils.plugin_registry import Plugin, PluginRegistry
9+
from altair.vegalite.v5.schema._config import ThemeConfig
910

1011
if sys.version_info >= (3, 11):
1112
from typing import LiteralString
@@ -16,12 +17,12 @@
1617
from altair.utils.plugin_registry import PluginEnabler
1718
from altair.vegalite.v5.theme import AltairThemes, VegaThemes
1819

19-
ThemeType = Plugin[Dict[str, Any]]
20+
ThemeType = Plugin[ThemeConfig]
2021

2122

2223
# HACK: See for `LiteralString` requirement in `name`
2324
# https://github.com/vega/altair/pull/3526#discussion_r1743350127
24-
class ThemeRegistry(PluginRegistry[ThemeType, Dict[str, Any]]):
25+
class ThemeRegistry(PluginRegistry[ThemeType, ThemeConfig]):
2526
def enable(
2627
self, name: LiteralString | AltairThemes | VegaThemes | None = None, **options
2728
) -> PluginEnabler:

0 commit comments

Comments
 (0)