moose-lib 0.4.333__tar.gz → 0.4.335__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.333 → moose_lib-0.4.335}/PKG-INFO +1 -1
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/consumption.py +26 -4
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/internal.py +1 -1
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib.egg-info/PKG-INFO +1 -1
- {moose_lib-0.4.333 → moose_lib-0.4.335}/README.md +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/__init__.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/blocks.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/clients/__init__.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/clients/redis_client.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/commons.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/config/__init__.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/config/config_file.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/config/runtime.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/data_models.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/__init__.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/_registry.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/ingest_api.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/ingest_pipeline.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/life_cycle.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/materialized_view.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/olap_table.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/registry.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/sql_resource.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/stream.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/types.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/view.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2/workflow.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/dmv2-serializer.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/main.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/query_param.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/streaming/__init__.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/streaming/streaming_function_runner.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib/tasks.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib.egg-info/SOURCES.txt +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib.egg-info/dependency_links.txt +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib.egg-info/requires.txt +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/moose_lib.egg-info/top_level.txt +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/setup.cfg +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/setup.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/tests/__init__.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/tests/conftest.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/tests/test_moose.py +0 -0
- {moose_lib-0.4.333 → moose_lib-0.4.335}/tests/test_redis_client.py +0 -0
|
@@ -17,6 +17,9 @@ from ._registry import _egress_apis
|
|
|
17
17
|
# Global base URL configuration
|
|
18
18
|
_global_base_url: Optional[str] = None
|
|
19
19
|
|
|
20
|
+
def _generate_api_key(name: str, version: Optional[str] = None) -> str:
|
|
21
|
+
return f"{name}:{version}" if version else name
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
def set_moose_base_url(url: str) -> None:
|
|
22
25
|
"""Set the global base URL for consumption API calls.
|
|
@@ -88,13 +91,32 @@ class ConsumptionApi(BaseTypedResource, Generic[U]):
|
|
|
88
91
|
|
|
89
92
|
return curried_constructor
|
|
90
93
|
|
|
91
|
-
def __init__(self, name: str, query_function: Callable[..., U], config: EgressConfig =
|
|
94
|
+
def __init__(self, name: str, query_function: Callable[..., U], config: EgressConfig = None, version: str = None, **kwargs):
|
|
92
95
|
super().__init__()
|
|
93
96
|
self._set_type(name, self._get_type(kwargs))
|
|
94
|
-
|
|
97
|
+
|
|
98
|
+
# Handle config and version parameters properly
|
|
99
|
+
if config is not None:
|
|
100
|
+
# If config is provided, use it as base
|
|
101
|
+
if version is not None:
|
|
102
|
+
# If version is also provided, update the config's version
|
|
103
|
+
self.config = EgressConfig(
|
|
104
|
+
version=version,
|
|
105
|
+
metadata=config.metadata
|
|
106
|
+
)
|
|
107
|
+
else:
|
|
108
|
+
# Use the provided config as-is
|
|
109
|
+
self.config = config
|
|
110
|
+
elif version is not None:
|
|
111
|
+
# Only version provided, create new config with version
|
|
112
|
+
self.config = EgressConfig(version=version)
|
|
113
|
+
else:
|
|
114
|
+
# Neither provided, use default config
|
|
115
|
+
self.config = EgressConfig()
|
|
116
|
+
|
|
95
117
|
self.query_function = query_function
|
|
96
|
-
self.metadata = config
|
|
97
|
-
_egress_apis[name] = self
|
|
118
|
+
self.metadata = getattr(self.config, 'metadata', {}) or {}
|
|
119
|
+
_egress_apis[_generate_api_key(name, self.config.version)] = self
|
|
98
120
|
|
|
99
121
|
@classmethod
|
|
100
122
|
def _get_type(cls, keyword_args: dict):
|
|
@@ -328,7 +328,7 @@ def to_infra_map() -> dict:
|
|
|
328
328
|
|
|
329
329
|
for name, api in get_consumption_apis().items():
|
|
330
330
|
egress_apis[name] = EgressApiConfig(
|
|
331
|
-
name=name,
|
|
331
|
+
name=api.name,
|
|
332
332
|
query_params=_to_columns(api.model_type),
|
|
333
333
|
response_schema=api.get_response_schema(),
|
|
334
334
|
version=api.config.version,
|
|
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
|