moose-lib 0.6.141__tar.gz → 0.6.142__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.141 → moose_lib-0.6.142}/PKG-INFO +1 -1
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/data_models.py +13 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/olap_table.py +3 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/internal.py +2 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib.egg-info/PKG-INFO +1 -1
- {moose_lib-0.6.141 → moose_lib-0.6.142}/README.md +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/__init__.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/blocks.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/clients/__init__.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/clients/redis_client.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/commons.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/config/__init__.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/config/config_file.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/config/runtime.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/__init__.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/_registry.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/consumption.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/ingest_api.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/ingest_pipeline.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/life_cycle.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/materialized_view.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/registry.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/sql_resource.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/stream.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/types.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/view.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/web_app.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/web_app_helpers.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2/workflow.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/dmv2_serializer.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/main.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/query_builder.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/query_param.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/streaming/__init__.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/streaming/streaming_function_runner.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/utilities/__init__.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib/utilities/sql.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib.egg-info/SOURCES.txt +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib.egg-info/dependency_links.txt +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib.egg-info/requires.txt +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/moose_lib.egg-info/top_level.txt +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/setup.cfg +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/setup.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/__init__.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/conftest.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/test_moose.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/test_olap_table_versioning.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/test_query_builder.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/test_redis_client.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/test_s3queue_config.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/test_simple_aggregate.py +0 -0
- {moose_lib-0.6.141 → moose_lib-0.6.142}/tests/test_web_app.py +0 -0
|
@@ -35,6 +35,11 @@ def clickhouse_default(expression: str) -> ClickhouseDefault:
|
|
|
35
35
|
return ClickhouseDefault(expression=expression)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
@dataclasses.dataclass(frozen=True)
|
|
39
|
+
class ClickHouseTTL:
|
|
40
|
+
expression: str
|
|
41
|
+
|
|
42
|
+
|
|
38
43
|
def clickhouse_decimal(precision: int, scale: int) -> Type[Decimal]:
|
|
39
44
|
return Annotated[Decimal, Field(max_digits=precision, decimal_places=scale)]
|
|
40
45
|
|
|
@@ -194,6 +199,7 @@ class Column(BaseModel):
|
|
|
194
199
|
primary_key: bool
|
|
195
200
|
default: str | None = None
|
|
196
201
|
annotations: list[Tuple[str, Any]] = []
|
|
202
|
+
ttl: str | None = None
|
|
197
203
|
|
|
198
204
|
def to_expr(self):
|
|
199
205
|
# Lazy import to avoid circular dependency at import time
|
|
@@ -409,6 +415,12 @@ def _to_columns(model: type[BaseModel]) -> list[Column]:
|
|
|
409
415
|
None,
|
|
410
416
|
)
|
|
411
417
|
|
|
418
|
+
# Extract TTL expression from metadata, if provided
|
|
419
|
+
ttl_expr = next(
|
|
420
|
+
(md.expression for md in mds if isinstance(md, ClickHouseTTL)),
|
|
421
|
+
None,
|
|
422
|
+
)
|
|
423
|
+
|
|
412
424
|
columns.append(
|
|
413
425
|
Column(
|
|
414
426
|
name=column_name,
|
|
@@ -418,6 +430,7 @@ def _to_columns(model: type[BaseModel]) -> list[Column]:
|
|
|
418
430
|
primary_key=primary_key,
|
|
419
431
|
default=default_expr,
|
|
420
432
|
annotations=annotations,
|
|
433
|
+
ttl=ttl_expr,
|
|
421
434
|
)
|
|
422
435
|
)
|
|
423
436
|
return columns
|
|
@@ -131,6 +131,9 @@ class OlapConfig(BaseModel):
|
|
|
131
131
|
metadata: Optional[dict] = None
|
|
132
132
|
life_cycle: Optional[LifeCycle] = None
|
|
133
133
|
settings: Optional[dict[str, str]] = None
|
|
134
|
+
# Optional table-level TTL expression (without leading 'TTL')
|
|
135
|
+
ttl: Optional[str] = None
|
|
136
|
+
|
|
134
137
|
# Optional secondary/data-skipping indexes
|
|
135
138
|
class TableIndex(BaseModel):
|
|
136
139
|
name: str
|
|
@@ -170,6 +170,7 @@ class TableConfig(BaseModel):
|
|
|
170
170
|
life_cycle: Optional[str] = None
|
|
171
171
|
table_settings: Optional[dict[str, str]] = None
|
|
172
172
|
indexes: list[OlapConfig.TableIndex] = []
|
|
173
|
+
ttl: Optional[str] = None
|
|
173
174
|
|
|
174
175
|
|
|
175
176
|
class TopicConfig(BaseModel):
|
|
@@ -611,6 +612,7 @@ def to_infra_map() -> dict:
|
|
|
611
612
|
# Map 'settings' to 'table_settings' for internal use
|
|
612
613
|
table_settings=table_settings if table_settings else None,
|
|
613
614
|
indexes=table.config.indexes,
|
|
615
|
+
ttl=table.config.ttl,
|
|
614
616
|
)
|
|
615
617
|
|
|
616
618
|
for name, stream in get_streams().items():
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|