moose-lib 0.6.45__py3-none-any.whl → 0.6.47__py3-none-any.whl
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/blocks.py +36 -2
- moose_lib/internal.py +6 -1
- {moose_lib-0.6.45.dist-info → moose_lib-0.6.47.dist-info}/METADATA +1 -1
- {moose_lib-0.6.45.dist-info → moose_lib-0.6.47.dist-info}/RECORD +6 -6
- {moose_lib-0.6.45.dist-info → moose_lib-0.6.47.dist-info}/WHEEL +0 -0
- {moose_lib-0.6.45.dist-info → moose_lib-0.6.47.dist-info}/top_level.txt +0 -0
moose_lib/blocks.py
CHANGED
|
@@ -31,8 +31,18 @@ class MergeTreeEngine(EngineConfig):
|
|
|
31
31
|
|
|
32
32
|
@dataclass
|
|
33
33
|
class ReplacingMergeTreeEngine(EngineConfig):
|
|
34
|
-
"""Configuration for ReplacingMergeTree engine (with deduplication)
|
|
35
|
-
|
|
34
|
+
"""Configuration for ReplacingMergeTree engine (with deduplication)
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
ver: Optional column name for version tracking
|
|
38
|
+
is_deleted: Optional column name for deletion marking (requires ver)
|
|
39
|
+
"""
|
|
40
|
+
ver: Optional[str] = None
|
|
41
|
+
is_deleted: Optional[str] = None
|
|
42
|
+
|
|
43
|
+
def __post_init__(self):
|
|
44
|
+
if self.is_deleted and not self.ver:
|
|
45
|
+
raise ValueError("is_deleted requires ver to be specified")
|
|
36
46
|
|
|
37
47
|
@dataclass
|
|
38
48
|
class AggregatingMergeTreeEngine(EngineConfig):
|
|
@@ -118,6 +128,30 @@ class TableConfig:
|
|
|
118
128
|
engine=engine,
|
|
119
129
|
order_by=order_by
|
|
120
130
|
)
|
|
131
|
+
|
|
132
|
+
@classmethod
|
|
133
|
+
def with_replacing_merge_tree(cls,
|
|
134
|
+
name: str,
|
|
135
|
+
columns: Dict[str, str],
|
|
136
|
+
order_by: Optional[str] = None,
|
|
137
|
+
ver: Optional[str] = None,
|
|
138
|
+
is_deleted: Optional[str] = None,
|
|
139
|
+
**kwargs) -> 'TableConfig':
|
|
140
|
+
"""Create a table with ReplacingMergeTree engine
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
name: Table name
|
|
144
|
+
columns: Column definitions
|
|
145
|
+
order_by: Order by clause
|
|
146
|
+
ver: Optional version column name
|
|
147
|
+
is_deleted: Optional is_deleted column name (requires ver)
|
|
148
|
+
"""
|
|
149
|
+
return cls(
|
|
150
|
+
name=name,
|
|
151
|
+
columns=columns,
|
|
152
|
+
engine=ReplacingMergeTreeEngine(ver=ver, is_deleted=is_deleted),
|
|
153
|
+
order_by=order_by
|
|
154
|
+
)
|
|
121
155
|
|
|
122
156
|
# ==========================
|
|
123
157
|
# Legacy API Support (Deprecated)
|
moose_lib/internal.py
CHANGED
|
@@ -66,6 +66,8 @@ class MergeTreeConfigDict(BaseEngineConfigDict):
|
|
|
66
66
|
class ReplacingMergeTreeConfigDict(BaseEngineConfigDict):
|
|
67
67
|
"""Configuration for ReplacingMergeTree engine."""
|
|
68
68
|
engine: Literal["ReplacingMergeTree"] = "ReplacingMergeTree"
|
|
69
|
+
ver: Optional[str] = None
|
|
70
|
+
is_deleted: Optional[str] = None
|
|
69
71
|
|
|
70
72
|
class AggregatingMergeTreeConfigDict(BaseEngineConfigDict):
|
|
71
73
|
"""Configuration for AggregatingMergeTree engine."""
|
|
@@ -322,7 +324,10 @@ def _convert_engine_to_config_dict(engine: Union[ClickHouseEngines, EngineConfig
|
|
|
322
324
|
headers=engine.headers
|
|
323
325
|
)
|
|
324
326
|
elif isinstance(engine, ReplacingMergeTreeEngine):
|
|
325
|
-
return ReplacingMergeTreeConfigDict(
|
|
327
|
+
return ReplacingMergeTreeConfigDict(
|
|
328
|
+
ver=engine.ver,
|
|
329
|
+
is_deleted=engine.is_deleted
|
|
330
|
+
)
|
|
326
331
|
elif isinstance(engine, AggregatingMergeTreeEngine):
|
|
327
332
|
return AggregatingMergeTreeConfigDict()
|
|
328
333
|
elif isinstance(engine, SummingMergeTreeEngine):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
moose_lib/__init__.py,sha256=LiUdVqmtASPqbMF53dXVZzCdU1jtFVx62_tiSbW65a0,162
|
|
2
|
-
moose_lib/blocks.py,sha256=
|
|
2
|
+
moose_lib/blocks.py,sha256=gC8dlV3HI4R8lO2wAxgLzn8WjKEMBjLiKyNAy4bssGE,11379
|
|
3
3
|
moose_lib/commons.py,sha256=FUpRv8D3-LeGcjhcqtDyiimz5izwpCq53h50ydxC_uA,3711
|
|
4
4
|
moose_lib/data_models.py,sha256=PgoFXTzf4C66FlKUowMT4VOrwSRR9_bk36P43ub4LzU,10274
|
|
5
5
|
moose_lib/dmv2-serializer.py,sha256=CL_Pvvg8tJOT8Qk6hywDNzY8MYGhMVdTOw8arZi3jng,49
|
|
6
|
-
moose_lib/internal.py,sha256=
|
|
6
|
+
moose_lib/internal.py,sha256=p9WtKScfx012FgBdDs114iqzGbEwPzTMRabcQPjC-tA,20662
|
|
7
7
|
moose_lib/main.py,sha256=XcVX_sTnt5QbrPXKNLCKZGCvpFpE8oiqSG2S1So9ztI,16713
|
|
8
8
|
moose_lib/query_param.py,sha256=kxcR09BMIsEg4o2qetjKrVu1YFRaLfMEzwzyGsKUpvA,6474
|
|
9
9
|
moose_lib/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -34,7 +34,7 @@ tests/conftest.py,sha256=ZVJNbnr4DwbcqkTmePW6U01zAzE6QD0kNAEZjPG1f4s,169
|
|
|
34
34
|
tests/test_moose.py,sha256=mBsx_OYWmL8ppDzL_7Bd7xR6qf_i3-pCIO3wm2iQNaA,2136
|
|
35
35
|
tests/test_redis_client.py,sha256=d9_MLYsJ4ecVil_jPB2gW3Q5aWnavxmmjZg2uYI3LVo,3256
|
|
36
36
|
tests/test_s3queue_config.py,sha256=F05cnD61S2wBKPabcpEJxf55-DJGF4nLqwBb6aFbprc,9741
|
|
37
|
-
moose_lib-0.6.
|
|
38
|
-
moose_lib-0.6.
|
|
39
|
-
moose_lib-0.6.
|
|
40
|
-
moose_lib-0.6.
|
|
37
|
+
moose_lib-0.6.47.dist-info/METADATA,sha256=AQzAoft2M23oy3stkpoDG_Nyn-m6C0VaqWg-Y9kUzvo,730
|
|
38
|
+
moose_lib-0.6.47.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
39
|
+
moose_lib-0.6.47.dist-info/top_level.txt,sha256=XEns2-4aCmGp2XjJAeEH9TAUcGONLnSLy6ycT9FSJh8,16
|
|
40
|
+
moose_lib-0.6.47.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|