Skip to content

Commit 8c60951

Browse files
authored
Update ty to 0.0.9 (#305)
1 parent aeafbee commit 8c60951

3 files changed

Lines changed: 55 additions & 55 deletions

File tree

skeleton/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _generate_class_name_and_lines(
101101
)
102102
for child_name in skeleton
103103
}
104-
case origin, (name_type, value_type) if origin is dict:
104+
case origin, (name_type, value_type) if origin is Mapping:
105105
assert isinstance(skeleton, Mapping)
106106
assert name_type is str
107107
class_name_and_lines_from_attribute_name = {

skeleton/typing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from collections.abc import Set as AbstractSet
1+
from collections.abc import Mapping, Set as AbstractSet
22
from typing import Annotated, TypeAlias
33

44
from typing_extensions import TypedDict
@@ -7,14 +7,14 @@
77

88
_ColumnSkeleton: TypeAlias = Annotated[str, Node(key_length=2)]
99
_TableSkeleton: TypeAlias = Annotated[AbstractSet[_ColumnSkeleton], Node()]
10-
_TablesSkeleton: TypeAlias = dict[str, _TableSkeleton]
10+
_TablesSkeleton: TypeAlias = Mapping[str, _TableSkeleton]
1111

1212
_LevelSkeleton: TypeAlias = Annotated[str, Node(key_length=3)]
1313
_HierarchySkeleton: TypeAlias = Annotated[
1414
AbstractSet[_LevelSkeleton], Node(key_length=2)
1515
]
16-
_DimensionSkeleton: TypeAlias = dict[str, _HierarchySkeleton]
17-
_DimensionsSkeleton: TypeAlias = dict[str, _DimensionSkeleton]
16+
_DimensionSkeleton: TypeAlias = Mapping[str, _HierarchySkeleton]
17+
_DimensionsSkeleton: TypeAlias = Mapping[str, _DimensionSkeleton]
1818

1919
_MeasureSkeleton: TypeAlias = Annotated[str, Node()]
2020
_MeasuresSkeleton: TypeAlias = AbstractSet[_MeasureSkeleton]
@@ -27,7 +27,7 @@ class __CubeSkeleton(TypedDict):
2727

2828
_CubeSkeleton: TypeAlias = Annotated[__CubeSkeleton, Node()]
2929

30-
_CubesSkeleton: TypeAlias = dict[str, _CubeSkeleton]
30+
_CubesSkeleton: TypeAlias = Mapping[str, _CubeSkeleton]
3131

3232

3333
class Skeleton(TypedDict):

0 commit comments

Comments
 (0)