moose-lib 0.6.11__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.11 → moose_lib-0.6.12}/PKG-INFO +1 -1
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/data_models.py +17 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib.egg-info/PKG-INFO +1 -1
- {moose_lib-0.6.11 → moose_lib-0.6.12}/README.md +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/__init__.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/blocks.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/clients/__init__.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/clients/redis_client.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/commons.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/config/__init__.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/config/config_file.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/config/runtime.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/__init__.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/_registry.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/consumption.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/ingest_api.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/ingest_pipeline.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/life_cycle.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/materialized_view.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/olap_table.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/registry.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/sql_resource.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/stream.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/types.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/view.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2/workflow.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/dmv2-serializer.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/internal.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/main.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/query_param.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/streaming/__init__.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/streaming/streaming_function_runner.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib/tasks.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib.egg-info/SOURCES.txt +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib.egg-info/dependency_links.txt +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib.egg-info/requires.txt +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/moose_lib.egg-info/top_level.txt +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/setup.cfg +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/setup.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/tests/__init__.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/tests/conftest.py +0 -0
- {moose_lib-0.6.11 → moose_lib-0.6.12}/tests/test_moose.py +0 -0
- {moose_lib-0.6.11 → 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
|
)
|
|
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
|
|
File without changes
|