fred-oss 0.27.0__tar.gz → 0.29.0__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.
- {fred_oss-0.27.0/src/main/fred_oss.egg-info → fred_oss-0.29.0}/PKG-INFO +1 -1
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/impl.py +14 -0
- fred_oss-0.29.0/src/main/fred/version +1 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/interface.py +16 -3
- {fred_oss-0.27.0 → fred_oss-0.29.0/src/main/fred_oss.egg-info}/PKG-INFO +1 -1
- fred_oss-0.27.0/src/main/fred/version +0 -1
- {fred_oss-0.27.0 → fred_oss-0.29.0}/MANIFEST.in +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/NOTICE.txt +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/README.md +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/requirements.txt +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/setup.cfg +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/setup.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/__main__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/interface.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/cli/main.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/_keyval.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/_queue.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/catalog.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/comp/interface.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/_redis.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/_stdlib.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/catalog.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/interface.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/dao/service/utils.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/_function.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/catalog.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/callback/interface.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/result.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/settings.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/future/utils.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/cli_ext.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtime.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/scanner.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/sync.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/wrappers/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/wrappers/dbutils.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/runpod/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/runpod/cli_ext.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/runpod/helper.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/maturity.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/_either.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/catalog.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/monad/interface.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/settings.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/utils/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/utils/dateops.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/utils/runtime.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/version.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/client.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/handler.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/info.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/_local.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/catalog.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/plugins/interface.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/cli_ext.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/__init__.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/_runner.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/catalog.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/routers/interface.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/rest/server.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/worker/runner/utils.py +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/SOURCES.txt +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/dependency_links.txt +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/entry_points.txt +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/requires.txt +0 -0
- {fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred_oss.egg-info/top_level.txt +0 -0
|
@@ -146,6 +146,20 @@ class Future(MonadInterface[A]):
|
|
|
146
146
|
case _:
|
|
147
147
|
raise TypeError("Unknown FutureResult type")
|
|
148
148
|
|
|
149
|
+
def getwhatevernow(self) -> Optional[EitherMonad.Either[A]]:
|
|
150
|
+
"""Gets the current result of the future without waiting.
|
|
151
|
+
If the future is not yet completed, returns None.
|
|
152
|
+
If the future is completed, returns the result as an Either monad.
|
|
153
|
+
|
|
154
|
+
Returns:
|
|
155
|
+
Optional[Either[A]]: None if the future is not completed; otherwise, an Either monad containing the result or exception.
|
|
156
|
+
"""
|
|
157
|
+
match self._result:
|
|
158
|
+
case FutureDefined(value=value):
|
|
159
|
+
return value
|
|
160
|
+
case _:
|
|
161
|
+
return None
|
|
162
|
+
|
|
149
163
|
@property
|
|
150
164
|
def state(self) -> Optional[str]:
|
|
151
165
|
"""Returns the current state of the future as a string.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.29.0
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import time
|
|
2
|
-
from typing import Callable, Optional
|
|
2
|
+
from typing import overload, Callable, Optional
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
4
|
|
|
5
|
+
from fred.future.impl import Future # Should we make this import lazy?
|
|
5
6
|
from fred.utils.dateops import datetime_utcnow
|
|
6
7
|
from fred.settings import (
|
|
7
8
|
get_environ_variable,
|
|
@@ -137,15 +138,27 @@ class HandlerInterface:
|
|
|
137
138
|
metadata_serialized = json.dumps(self.metadata, default=str)
|
|
138
139
|
return json.loads(metadata_serialized)
|
|
139
140
|
|
|
140
|
-
|
|
141
|
+
@overload
|
|
142
|
+
def run(self, event: dict, as_future: bool = True) -> Future[dict]:
|
|
143
|
+
...
|
|
144
|
+
|
|
145
|
+
@overload
|
|
146
|
+
def run(self, event: dict, as_future: bool = False) -> dict:
|
|
147
|
+
...
|
|
148
|
+
|
|
149
|
+
def run(self, event: dict, as_future: bool = False) -> dict | Future[dict]:
|
|
141
150
|
"""Process an incoming event and return a structured response.
|
|
142
151
|
The event is expected to be a dictionary with at least an 'id' and 'input' keys.
|
|
143
152
|
The 'input' key should contain the payload to be processed.
|
|
144
153
|
Args:
|
|
145
154
|
event (dict): The incoming event containing 'id' and 'input'.
|
|
155
|
+
as_future (bool): If True, the processing will be done in a Future; otherwise, it will be synchronous.
|
|
146
156
|
Returns:
|
|
147
|
-
dict: A structured response containing the result of processing the event.
|
|
157
|
+
dict | Future[dict]: A structured response containing the result of processing the event.
|
|
158
|
+
If requested as a Future, returns a Future that will resolve to the response dictionary.
|
|
148
159
|
"""
|
|
160
|
+
if as_future:
|
|
161
|
+
return Future(function=lambda: self.run(event=event, as_future=False))
|
|
149
162
|
# Extract payload and event ID
|
|
150
163
|
payload = event.get("input", {})
|
|
151
164
|
job_event_identifier = event.get("id")
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.27.0
|
|
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
|
{fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/__init__.py
RENAMED
|
File without changes
|
{fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/runtimes/scanner.py
RENAMED
|
File without changes
|
|
File without changes
|
{fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/wrappers/__init__.py
RENAMED
|
File without changes
|
{fred_oss-0.27.0 → fred_oss-0.29.0}/src/main/fred/integrations/databricks/wrappers/dbutils.py
RENAMED
|
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
|