2
2
3
3
from abc import ABC , abstractmethod
4
4
from dataclasses import dataclass
5
- from typing import TYPE_CHECKING , Literal , TypeAlias , TypedDict , cast
5
+ from typing import TYPE_CHECKING , ClassVar , Literal , TypeAlias , TypedDict , cast
6
6
7
7
if TYPE_CHECKING :
8
8
from typing import NotRequired , Self
@@ -30,7 +30,7 @@ class ChunkKeyEncodingParams(TypedDict):
30
30
31
31
@dataclass (frozen = True )
32
32
class ChunkKeyEncoding (ABC , Metadata ):
33
- name : str
33
+ name : ClassVar [ str ]
34
34
separator : SeparatorLiteral = "."
35
35
36
36
def __post_init__ (self ) -> None :
@@ -65,7 +65,7 @@ def encode_chunk_key(self, chunk_coords: tuple[int, ...]) -> str:
65
65
66
66
@dataclass (frozen = True )
67
67
class DefaultChunkKeyEncoding (ChunkKeyEncoding ):
68
- name : Literal ["default" ] = "default"
68
+ name : ClassVar [ Literal ["default" ] ] = "default"
69
69
separator : SeparatorLiteral = "/" # default
70
70
71
71
def decode_chunk_key (self , chunk_key : str ) -> tuple [int , ...]:
@@ -79,7 +79,7 @@ def encode_chunk_key(self, chunk_coords: tuple[int, ...]) -> str:
79
79
80
80
@dataclass (frozen = True )
81
81
class V2ChunkKeyEncoding (ChunkKeyEncoding ):
82
- name : Literal ["v2" ] = "v2"
82
+ name : ClassVar [ Literal ["v2" ] ] = "v2"
83
83
separator : SeparatorLiteral = "." # default
84
84
85
85
def decode_chunk_key (self , chunk_key : str ) -> tuple [int , ...]:
0 commit comments