moose-lib 0.4.260__tar.gz → 0.4.261__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.
Potentially problematic release.
This version of moose-lib might be problematic. Click here for more details.
- {moose_lib-0.4.260 → moose_lib-0.4.261}/PKG-INFO +1 -1
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/data_models.py +12 -12
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib.egg-info/PKG-INFO +1 -1
- {moose_lib-0.4.260 → moose_lib-0.4.261}/README.md +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/__init__.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/blocks.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/clients/__init__.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/clients/redis_client.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/commons.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/config/__init__.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/config/config_file.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/config/runtime.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/__init__.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/_registry.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/consumption.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/ingest_api.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/ingest_pipeline.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/materialized_view.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/olap_table.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/registry.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/sql_resource.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/stream.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/types.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/view.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2/workflow.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/dmv2-serializer.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/internal.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/main.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/query_param.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/streaming/__init__.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/streaming/streaming_function_runner.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib/tasks.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib.egg-info/SOURCES.txt +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib.egg-info/dependency_links.txt +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib.egg-info/requires.txt +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/moose_lib.egg-info/top_level.txt +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/setup.cfg +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/setup.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/tests/__init__.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/tests/conftest.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/tests/test_moose.py +0 -0
- {moose_lib-0.4.260 → moose_lib-0.4.261}/tests/test_redis_client.py +0 -0
|
@@ -15,8 +15,6 @@ import ipaddress
|
|
|
15
15
|
type Key[T: (str, int)] = T
|
|
16
16
|
type JWT[T] = T
|
|
17
17
|
|
|
18
|
-
type Aggregated[T, agg_func] = Annotated[T, agg_func]
|
|
19
|
-
|
|
20
18
|
|
|
21
19
|
@dataclasses.dataclass # a BaseModel in the annotations will confuse pydantic
|
|
22
20
|
class ClickhousePrecision:
|
|
@@ -41,8 +39,16 @@ def clickhouse_datetime64(precision: int) -> Type[datetime]:
|
|
|
41
39
|
return Annotated[datetime, ClickhousePrecision(precision=precision)]
|
|
42
40
|
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
def aggregated[T](
|
|
43
|
+
result_type: Type[T],
|
|
44
|
+
agg_func: str,
|
|
45
|
+
param_types: list[type | GenericAlias | _BaseGenericAlias]
|
|
46
|
+
) -> Type[T]:
|
|
47
|
+
return Annotated[result_type, AggregateFunction(agg_func=agg_func, param_types=param_types)]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclasses.dataclass
|
|
51
|
+
class AggregateFunction:
|
|
46
52
|
agg_func: str
|
|
47
53
|
param_types: list[type | GenericAlias | _BaseGenericAlias]
|
|
48
54
|
|
|
@@ -120,12 +126,6 @@ def handle_annotation(t: type, md: list[Any]) -> Tuple[type, list[Any]]:
|
|
|
120
126
|
return handle_annotation(t.__value__, md)
|
|
121
127
|
if get_origin(t) is Annotated:
|
|
122
128
|
return handle_annotation(t.__origin__, md + list(t.__metadata__)) # type: ignore
|
|
123
|
-
if get_origin(t) is Aggregated:
|
|
124
|
-
args = get_args(t)
|
|
125
|
-
agg_func = args[1]
|
|
126
|
-
if not isinstance(agg_func, AggregateFunction):
|
|
127
|
-
raise ValueError("Pass an AggregateFunction to Aggregated")
|
|
128
|
-
return handle_annotation(args[0], md + [agg_func])
|
|
129
129
|
return t, md
|
|
130
130
|
|
|
131
131
|
|
|
@@ -285,8 +285,8 @@ class StringToEnumMixin:
|
|
|
285
285
|
def is_array_nested_type(data_type: DataType) -> bool:
|
|
286
286
|
"""Type guard to check if a data type is Array(Nested(...))."""
|
|
287
287
|
return (
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
isinstance(data_type, ArrayType) and
|
|
289
|
+
isinstance(data_type.element_type, Nested)
|
|
290
290
|
)
|
|
291
291
|
|
|
292
292
|
|
|
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
|
|
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
|