Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion skeleton/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _generate_class_name_and_lines(
)
for child_name in skeleton
}
case origin, (name_type, value_type) if origin is dict:
case origin, (name_type, value_type) if origin is Mapping:
assert isinstance(skeleton, Mapping)
assert name_type is str
class_name_and_lines_from_attribute_name = {
Expand Down
10 changes: 5 additions & 5 deletions skeleton/typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections.abc import Set as AbstractSet
from collections.abc import Mapping, Set as AbstractSet
from typing import Annotated, TypeAlias

from typing_extensions import TypedDict
Expand All @@ -7,14 +7,14 @@

_ColumnSkeleton: TypeAlias = Annotated[str, Node(key_length=2)]
_TableSkeleton: TypeAlias = Annotated[AbstractSet[_ColumnSkeleton], Node()]
_TablesSkeleton: TypeAlias = dict[str, _TableSkeleton]
_TablesSkeleton: TypeAlias = Mapping[str, _TableSkeleton]

_LevelSkeleton: TypeAlias = Annotated[str, Node(key_length=3)]
_HierarchySkeleton: TypeAlias = Annotated[
AbstractSet[_LevelSkeleton], Node(key_length=2)
]
_DimensionSkeleton: TypeAlias = dict[str, _HierarchySkeleton]
_DimensionsSkeleton: TypeAlias = dict[str, _DimensionSkeleton]
_DimensionSkeleton: TypeAlias = Mapping[str, _HierarchySkeleton]
_DimensionsSkeleton: TypeAlias = Mapping[str, _DimensionSkeleton]

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

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

_CubesSkeleton: TypeAlias = dict[str, _CubeSkeleton]
_CubesSkeleton: TypeAlias = Mapping[str, _CubeSkeleton]


class Skeleton(TypedDict):
Expand Down
Loading
Loading