moose-lib 0.6.10__tar.gz → 0.6.12__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.6.10 → moose_lib-0.6.12}/PKG-INFO +1 -1
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/data_models.py +17 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/__init__.py +12 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/consumption.py +8 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/registry.py +9 -1
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/main.py +5 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib.egg-info/PKG-INFO +1 -1
- {moose_lib-0.6.10 → moose_lib-0.6.12}/README.md +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/__init__.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/blocks.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/clients/__init__.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/clients/redis_client.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/commons.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/config/__init__.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/config/config_file.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/config/runtime.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/_registry.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/ingest_api.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/ingest_pipeline.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/life_cycle.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/materialized_view.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/olap_table.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/sql_resource.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/stream.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/types.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/view.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2/workflow.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/dmv2-serializer.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/internal.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/query_param.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/streaming/__init__.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/streaming/streaming_function_runner.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib/tasks.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib.egg-info/SOURCES.txt +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib.egg-info/dependency_links.txt +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib.egg-info/requires.txt +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/moose_lib.egg-info/top_level.txt +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/setup.cfg +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/setup.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/tests/__init__.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/tests/conftest.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/tests/test_moose.py +0 -0
- {moose_lib-0.6.10 → moose_lib-0.6.12}/tests/test_redis_client.py +0 -0
|
@@ -26,6 +26,15 @@ class ClickhouseSize:
|
|
|
26
26
|
size: int
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
@dataclasses.dataclass
|
|
30
|
+
class ClickhouseDefault:
|
|
31
|
+
expression: str
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def clickhouse_default(expression: str) -> ClickhouseDefault:
|
|
35
|
+
return ClickhouseDefault(expression=expression)
|
|
36
|
+
|
|
37
|
+
|
|
29
38
|
def clickhouse_decimal(precision: int, scale: int) -> Type[Decimal]:
|
|
30
39
|
return Annotated[Decimal, Field(max_digits=precision, decimal_places=scale)]
|
|
31
40
|
|
|
@@ -135,6 +144,7 @@ class Column(BaseModel):
|
|
|
135
144
|
required: bool
|
|
136
145
|
unique: Literal[False]
|
|
137
146
|
primary_key: bool
|
|
147
|
+
default: str | None = None
|
|
138
148
|
annotations: list[Tuple[str, Any]] = []
|
|
139
149
|
|
|
140
150
|
|
|
@@ -255,6 +265,12 @@ def _to_columns(model: type[BaseModel]) -> list[Column]:
|
|
|
255
265
|
|
|
256
266
|
column_name = field_name if field_info.alias is None else field_info.alias
|
|
257
267
|
|
|
268
|
+
# Extract default expression from metadata, if provided
|
|
269
|
+
default_expr = next(
|
|
270
|
+
(md.expression for md in mds if isinstance(md, ClickhouseDefault)),
|
|
271
|
+
None,
|
|
272
|
+
)
|
|
273
|
+
|
|
258
274
|
columns.append(
|
|
259
275
|
Column(
|
|
260
276
|
name=column_name,
|
|
@@ -262,6 +278,7 @@ def _to_columns(model: type[BaseModel]) -> list[Column]:
|
|
|
262
278
|
required=not optional,
|
|
263
279
|
unique=False,
|
|
264
280
|
primary_key=primary_key,
|
|
281
|
+
default=default_expr,
|
|
265
282
|
annotations=annotations,
|
|
266
283
|
)
|
|
267
284
|
)
|
|
@@ -46,6 +46,9 @@ from .consumption import (
|
|
|
46
46
|
Api,
|
|
47
47
|
get_moose_base_url,
|
|
48
48
|
set_moose_base_url,
|
|
49
|
+
# Backward compatibility aliases
|
|
50
|
+
ConsumptionApi,
|
|
51
|
+
EgressConfig,
|
|
49
52
|
)
|
|
50
53
|
|
|
51
54
|
from .sql_resource import (
|
|
@@ -85,6 +88,9 @@ from .registry import (
|
|
|
85
88
|
get_sql_resource,
|
|
86
89
|
get_workflows,
|
|
87
90
|
get_workflow,
|
|
91
|
+
# Backward compatibility aliases
|
|
92
|
+
get_consumption_apis,
|
|
93
|
+
get_consumption_api,
|
|
88
94
|
)
|
|
89
95
|
|
|
90
96
|
__all__ = [
|
|
@@ -123,6 +129,9 @@ __all__ = [
|
|
|
123
129
|
'Api',
|
|
124
130
|
'get_moose_base_url',
|
|
125
131
|
'set_moose_base_url',
|
|
132
|
+
# Backward compatibility aliases (deprecated)
|
|
133
|
+
'ConsumptionApi',
|
|
134
|
+
'EgressConfig',
|
|
126
135
|
|
|
127
136
|
# SQL
|
|
128
137
|
'SqlResource',
|
|
@@ -152,4 +161,7 @@ __all__ = [
|
|
|
152
161
|
'get_sql_resource',
|
|
153
162
|
'get_workflows',
|
|
154
163
|
'get_workflow',
|
|
164
|
+
# Backward compatibility aliases (deprecated)
|
|
165
|
+
'get_consumption_apis',
|
|
166
|
+
'get_consumption_api',
|
|
155
167
|
]
|
|
@@ -228,3 +228,11 @@ class Api(BaseTypedResource, Generic[U]):
|
|
|
228
228
|
# Parse JSON response and return as the expected type
|
|
229
229
|
response_data = response.json()
|
|
230
230
|
return self._u.model_validate(response_data)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
# Backward compatibility aliases (deprecated)
|
|
234
|
+
ConsumptionApi = Api
|
|
235
|
+
"""@deprecated: Use Api instead of ConsumptionApi"""
|
|
236
|
+
|
|
237
|
+
EgressConfig = ApiConfig
|
|
238
|
+
"""@deprecated: Use ApiConfig instead of EgressConfig"""
|
|
@@ -70,4 +70,12 @@ def get_workflows() -> Dict[str, Workflow]:
|
|
|
70
70
|
|
|
71
71
|
def get_workflow(name: str) -> Optional[Workflow]:
|
|
72
72
|
"""Get a registered workflow by name."""
|
|
73
|
-
return _workflows.get(name)
|
|
73
|
+
return _workflows.get(name)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# Backward compatibility aliases (deprecated)
|
|
77
|
+
get_consumption_apis = get_apis
|
|
78
|
+
"""@deprecated: Use get_apis instead of get_consumption_apis"""
|
|
79
|
+
|
|
80
|
+
get_consumption_api = get_api
|
|
81
|
+
"""@deprecated: Use get_api instead of get_consumption_api"""
|
|
@@ -147,6 +147,11 @@ class ApiResult:
|
|
|
147
147
|
body: Any
|
|
148
148
|
|
|
149
149
|
|
|
150
|
+
# Backward compatibility alias (deprecated)
|
|
151
|
+
ConsumptionApiResult = ApiResult
|
|
152
|
+
"""@deprecated: Use ApiResult instead of ConsumptionApiResult"""
|
|
153
|
+
|
|
154
|
+
|
|
150
155
|
class QueryClient:
|
|
151
156
|
"""Client for executing queries, typically against ClickHouse.
|
|
152
157
|
|
|
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
|