moose-lib 0.4.214__tar.gz → 0.4.216__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {moose_lib-0.4.214 → moose_lib-0.4.216}/PKG-INFO +1 -1
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/data_models.py +17 -5
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib.egg-info/PKG-INFO +1 -1
- {moose_lib-0.4.214 → moose_lib-0.4.216}/README.md +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/__init__.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/blocks.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/clients/__init__.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/clients/redis_client.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/commons.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/dmv2-serializer.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/dmv2.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/internal.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/main.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/query_param.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/streaming/__init__.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/streaming/streaming_function_runner.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib/tasks.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib.egg-info/SOURCES.txt +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib.egg-info/dependency_links.txt +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib.egg-info/requires.txt +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/moose_lib.egg-info/top_level.txt +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/setup.cfg +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/setup.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/tests/__init__.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/tests/conftest.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/tests/test_moose.py +0 -0
- {moose_lib-0.4.214 → moose_lib-0.4.216}/tests/test_redis_client.py +0 -0
@@ -83,7 +83,11 @@ class ArrayType(BaseModel):
|
|
83
83
|
element_nullable: bool
|
84
84
|
|
85
85
|
|
86
|
-
|
86
|
+
class NamedTupleType(BaseModel):
|
87
|
+
fields: list[tuple[str, "DataType"]]
|
88
|
+
|
89
|
+
|
90
|
+
type DataType = str | DataEnum | ArrayType | Nested | NamedTupleType
|
87
91
|
|
88
92
|
|
89
93
|
def handle_jwt(field_type: type) -> Tuple[bool, type]:
|
@@ -191,10 +195,18 @@ def py_type_to_column_type(t: type, mds: list[Any]) -> Tuple[bool, list[Any], Da
|
|
191
195
|
elif not isclass(t):
|
192
196
|
raise ValueError(f"Unknown type {t}")
|
193
197
|
elif issubclass(t, BaseModel):
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
+
if any(md == "ClickHouseNamedTuple" for md in mds):
|
199
|
+
data_type = NamedTupleType(
|
200
|
+
fields=[(
|
201
|
+
column.name,
|
202
|
+
column.data_type
|
203
|
+
) for column in _to_columns(t)],
|
204
|
+
)
|
205
|
+
else:
|
206
|
+
data_type = Nested(
|
207
|
+
name=t.__name__,
|
208
|
+
columns=_to_columns(t),
|
209
|
+
)
|
198
210
|
elif issubclass(t, Enum):
|
199
211
|
values = [EnumValue(name=member.name, value=member.value) for member in t]
|
200
212
|
data_type = DataEnum(name=t.__name__, values=values)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|