dbos 0.22.0a9__py3-none-any.whl → 0.22.0a10__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 dbos might be problematic. Click here for more details.
- dbos/_core.py +5 -3
- dbos/_dbos.py +12 -3
- dbos/_error.py +11 -0
- {dbos-0.22.0a9.dist-info → dbos-0.22.0a10.dist-info}/METADATA +1 -1
- {dbos-0.22.0a9.dist-info → dbos-0.22.0a10.dist-info}/RECORD +8 -8
- {dbos-0.22.0a9.dist-info → dbos-0.22.0a10.dist-info}/WHEEL +0 -0
- {dbos-0.22.0a9.dist-info → dbos-0.22.0a10.dist-info}/entry_points.txt +0 -0
- {dbos-0.22.0a9.dist-info → dbos-0.22.0a10.dist-info}/licenses/LICENSE +0 -0
dbos/_core.py
CHANGED
|
@@ -524,7 +524,7 @@ def decorate_workflow(
|
|
|
524
524
|
) -> Callable[[Callable[P, R]], Callable[P, R]]:
|
|
525
525
|
def _workflow_decorator(func: Callable[P, R]) -> Callable[P, R]:
|
|
526
526
|
wrapped_func = workflow_wrapper(reg, func, max_recovery_attempts)
|
|
527
|
-
reg.register_wf_function(func.__qualname__, wrapped_func)
|
|
527
|
+
reg.register_wf_function(func.__qualname__, wrapped_func, "workflow")
|
|
528
528
|
return wrapped_func
|
|
529
529
|
|
|
530
530
|
return _workflow_decorator
|
|
@@ -676,7 +676,9 @@ def decorate_transaction(
|
|
|
676
676
|
wrapped_wf = workflow_wrapper(dbosreg, temp_wf)
|
|
677
677
|
set_dbos_func_name(temp_wf, "<temp>." + func.__qualname__)
|
|
678
678
|
set_temp_workflow_type(temp_wf, "transaction")
|
|
679
|
-
dbosreg.register_wf_function(
|
|
679
|
+
dbosreg.register_wf_function(
|
|
680
|
+
get_dbos_func_name(temp_wf), wrapped_wf, "transaction"
|
|
681
|
+
)
|
|
680
682
|
wrapper.__orig_func = temp_wf # type: ignore
|
|
681
683
|
set_func_info(wrapped_wf, get_or_create_func_info(func))
|
|
682
684
|
set_func_info(temp_wf, get_or_create_func_info(func))
|
|
@@ -827,7 +829,7 @@ def decorate_step(
|
|
|
827
829
|
wrapped_wf = workflow_wrapper(dbosreg, temp_wf)
|
|
828
830
|
set_dbos_func_name(temp_wf, "<temp>." + func.__qualname__)
|
|
829
831
|
set_temp_workflow_type(temp_wf, "step")
|
|
830
|
-
dbosreg.register_wf_function(get_dbos_func_name(temp_wf), wrapped_wf)
|
|
832
|
+
dbosreg.register_wf_function(get_dbos_func_name(temp_wf), wrapped_wf, "step")
|
|
831
833
|
wrapper.__orig_func = temp_wf # type: ignore
|
|
832
834
|
set_func_info(wrapped_wf, get_or_create_func_info(func))
|
|
833
835
|
set_func_info(temp_wf, get_or_create_func_info(func))
|
dbos/_dbos.py
CHANGED
|
@@ -85,7 +85,11 @@ from ._context import (
|
|
|
85
85
|
get_local_dbos_context,
|
|
86
86
|
)
|
|
87
87
|
from ._dbos_config import ConfigFile, load_config, set_env_vars
|
|
88
|
-
from ._error import
|
|
88
|
+
from ._error import (
|
|
89
|
+
DBOSConflictingRegistrationError,
|
|
90
|
+
DBOSException,
|
|
91
|
+
DBOSNonExistentWorkflowError,
|
|
92
|
+
)
|
|
89
93
|
from ._logger import add_otlp_to_all_loggers, dbos_logger
|
|
90
94
|
from ._sys_db import SystemDatabase
|
|
91
95
|
|
|
@@ -144,6 +148,7 @@ RegisteredJob = Tuple[
|
|
|
144
148
|
class DBOSRegistry:
|
|
145
149
|
def __init__(self) -> None:
|
|
146
150
|
self.workflow_info_map: dict[str, Workflow[..., Any]] = {}
|
|
151
|
+
self.function_type_map: dict[str, str] = {}
|
|
147
152
|
self.class_info_map: dict[str, type] = {}
|
|
148
153
|
self.instance_info_map: dict[str, object] = {}
|
|
149
154
|
self.queue_info_map: dict[str, Queue] = {}
|
|
@@ -151,7 +156,11 @@ class DBOSRegistry:
|
|
|
151
156
|
self.dbos: Optional[DBOS] = None
|
|
152
157
|
self.config: Optional[ConfigFile] = None
|
|
153
158
|
|
|
154
|
-
def register_wf_function(self, name: str, wrapped_func: F) -> None:
|
|
159
|
+
def register_wf_function(self, name: str, wrapped_func: F, functype: str) -> None:
|
|
160
|
+
if name in self.function_type_map:
|
|
161
|
+
if self.function_type_map[name] != functype:
|
|
162
|
+
raise DBOSConflictingRegistrationError(name)
|
|
163
|
+
self.function_type_map[name] = functype
|
|
155
164
|
self.workflow_info_map[name] = wrapped_func
|
|
156
165
|
|
|
157
166
|
def register_class(self, cls: type, ci: DBOSClassInfo) -> None:
|
|
@@ -324,7 +333,7 @@ class DBOS:
|
|
|
324
333
|
temp_send_wf = workflow_wrapper(self._registry, send_temp_workflow)
|
|
325
334
|
set_dbos_func_name(send_temp_workflow, TEMP_SEND_WF_NAME)
|
|
326
335
|
set_temp_workflow_type(send_temp_workflow, "send")
|
|
327
|
-
self._registry.register_wf_function(TEMP_SEND_WF_NAME, temp_send_wf)
|
|
336
|
+
self._registry.register_wf_function(TEMP_SEND_WF_NAME, temp_send_wf, "send")
|
|
328
337
|
|
|
329
338
|
for handler in dbos_logger.handlers:
|
|
330
339
|
handler.flush()
|
dbos/_error.py
CHANGED
|
@@ -36,6 +36,7 @@ class DBOSErrorCode(Enum):
|
|
|
36
36
|
MaxStepRetriesExceeded = 7
|
|
37
37
|
NotAuthorized = 8
|
|
38
38
|
ConflictingWorkflowError = 9
|
|
39
|
+
ConflictingRegistrationError = 25
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
class DBOSWorkflowConflictIDError(DBOSException):
|
|
@@ -127,3 +128,13 @@ class DBOSMaxStepRetriesExceeded(DBOSException):
|
|
|
127
128
|
"Step reached maximum retries.",
|
|
128
129
|
dbos_error_code=DBOSErrorCode.MaxStepRetriesExceeded.value,
|
|
129
130
|
)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class DBOSConflictingRegistrationError(DBOSException):
|
|
134
|
+
"""Exception raised when conflicting decorators are applied to the same function."""
|
|
135
|
+
|
|
136
|
+
def __init__(self, name: str) -> None:
|
|
137
|
+
super().__init__(
|
|
138
|
+
f"Operation (Name: {name}) is already registered with a conflicting function type",
|
|
139
|
+
dbos_error_code=DBOSErrorCode.ConflictingRegistrationError.value,
|
|
140
|
+
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
dbos-0.22.
|
|
2
|
-
dbos-0.22.
|
|
3
|
-
dbos-0.22.
|
|
4
|
-
dbos-0.22.
|
|
1
|
+
dbos-0.22.0a10.dist-info/METADATA,sha256=f3lWGvBr4qZJNnterwFBCSEN-whlc8gon-wkjflQVvY,5310
|
|
2
|
+
dbos-0.22.0a10.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
|
3
|
+
dbos-0.22.0a10.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
|
4
|
+
dbos-0.22.0a10.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
|
5
5
|
dbos/__init__.py,sha256=CxRHBHEthPL4PZoLbZhp3rdm44-KkRTT2-7DkK9d4QQ,724
|
|
6
6
|
dbos/_admin_server.py,sha256=YiVn5lywz2Vg8_juyNHOYl0HVEy48--7b4phwK7r92o,5732
|
|
7
7
|
dbos/_app_db.py,sha256=_tv2vmPjjiaikwgxH3mqxgJ4nUUcG2-0uMXKWCqVu1c,5509
|
|
@@ -10,12 +10,12 @@ dbos/_cloudutils/authentication.py,sha256=V0fCWQN9stCkhbuuxgPTGpvuQcDqfU3KAxPAh0
|
|
|
10
10
|
dbos/_cloudutils/cloudutils.py,sha256=5e3CW1deSW-dI5G3QN0XbiVsBhyqT8wu7fuV2f8wtGU,7688
|
|
11
11
|
dbos/_cloudutils/databases.py,sha256=x4187Djsyoa-QaG3Kog8JT2_GERsnqa93LIVanmVUmg,8393
|
|
12
12
|
dbos/_context.py,sha256=gikN5lUVqnvR-ISoOElXYeYsR_BO2whebB3YP2DJBM4,17713
|
|
13
|
-
dbos/_core.py,sha256=
|
|
13
|
+
dbos/_core.py,sha256=b1IL3LDRGmomHhcs929n_G2pfFSmNuSxFrwhcBuo20k,35519
|
|
14
14
|
dbos/_croniter.py,sha256=hbhgfsHBqclUS8VeLnJ9PSE9Z54z6mi4nnrr1aUXn0k,47561
|
|
15
15
|
dbos/_db_wizard.py,sha256=6tfJaCRa1NtkUdNW75a2yvi_mEgnPJ9C1HP2zPG1hCU,8067
|
|
16
|
-
dbos/_dbos.py,sha256=
|
|
16
|
+
dbos/_dbos.py,sha256=h25S5Mjl1JAfwMEpqRdyBSuUB_HI3TC8J9Nqtqy_XwQ,38453
|
|
17
17
|
dbos/_dbos_config.py,sha256=DfiqVVxNqnafkocSzLqBp1Ig5vCviDTDK_GO3zTtQqI,8298
|
|
18
|
-
dbos/_error.py,sha256=
|
|
18
|
+
dbos/_error.py,sha256=NqlobQneZ2ycCQacXc8a38TIOHxFRjBXdF40i3wZUaA,4775
|
|
19
19
|
dbos/_fastapi.py,sha256=ke03vqsSYDnO6XeOtOVFXj0-f-v1MGsOxa9McaROvNc,3616
|
|
20
20
|
dbos/_flask.py,sha256=DZKUZR5-xOzPI7tYZ53r2PvvHVoAb8SYwLzMVFsVfjI,2608
|
|
21
21
|
dbos/_kafka.py,sha256=o6DbwnsYRDtvVTZVsN7BAK8cdP79AfoWX3Q7CGY2Yuo,4199
|
|
@@ -60,4 +60,4 @@ dbos/cli/cli.py,sha256=_tXw2IQrWW7fV_h51f_R99vEBSi6aMLz-vCOxKaENiQ,14155
|
|
|
60
60
|
dbos/dbos-config.schema.json,sha256=X5TpXNcARGceX0zQs0fVgtZW_Xj9uBbY5afPt9Rz9yk,5741
|
|
61
61
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
|
62
62
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
|
63
|
-
dbos-0.22.
|
|
63
|
+
dbos-0.22.0a10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|