dbos 0.22.0a9__tar.gz → 0.22.0a10__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 dbos might be problematic. Click here for more details.
- {dbos-0.22.0a9 → dbos-0.22.0a10}/PKG-INFO +1 -1
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_core.py +5 -3
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_dbos.py +12 -3
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_error.py +11 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/pyproject.toml +1 -1
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_dbos.py +15 -1
- {dbos-0.22.0a9 → dbos-0.22.0a10}/LICENSE +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/README.md +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/__init__.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_admin_server.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_app_db.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_classproperty.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_cloudutils/authentication.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_cloudutils/cloudutils.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_cloudutils/databases.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_context.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_croniter.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_db_wizard.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_dbos_config.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_fastapi.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_flask.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_kafka.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_kafka_message.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_logger.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/env.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/script.py.mako +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/04ca4f231047_workflow_queues_executor_id.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/50f3227f0b4b_fix_job_queue.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/5c361fc04708_added_system_tables.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/d76646551a6b_job_queue_limiter.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/d76646551a6c_workflow_queue.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/eab0cc1d9a14_job_queue.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_outcome.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_queue.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_recovery.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_registrations.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_request.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_roles.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_scheduler.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_schemas/__init__.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_schemas/application_database.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_schemas/system_database.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_serialization.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_sys_db.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/README.md +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/__package/__init__.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/__package/main.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/__package/schema.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/alembic.ini +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/migrations/env.py.dbos +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/migrations/script.py.mako +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_templates/dbos-db-starter/start_postgres_docker.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_tracer.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_workflow_commands.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/cli/_github_init.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/cli/_template_init.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/cli/cli.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/dbos-config.schema.json +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/py.typed +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/__init__.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/atexit_no_ctor.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/atexit_no_launch.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/classdefs.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/conftest.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/more_classdefs.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/queuedworkflow.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_admin_server.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_async.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_classdecorators.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_concurrency.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_config.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_croniter.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_failures.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_fastapi.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_fastapi_roles.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_flask.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_kafka.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_outcome.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_package.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_queue.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_scheduler.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_schema_migration.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_singleton.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_spans.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_sqlalchemy.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/tests/test_workflow_cmds.py +0 -0
- {dbos-0.22.0a9 → dbos-0.22.0a10}/version/__init__.py +0 -0
|
@@ -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))
|
|
@@ -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()
|
|
@@ -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
|
+
)
|
|
@@ -16,7 +16,7 @@ from dbos import DBOS, ConfigFile, SetWorkflowID, WorkflowHandle, WorkflowStatus
|
|
|
16
16
|
|
|
17
17
|
# Private API because this is a test
|
|
18
18
|
from dbos._context import assert_current_dbos_context, get_local_dbos_context
|
|
19
|
-
from dbos._error import DBOSMaxStepRetriesExceeded
|
|
19
|
+
from dbos._error import DBOSConflictingRegistrationError, DBOSMaxStepRetriesExceeded
|
|
20
20
|
from dbos._schemas.system_database import SystemSchema
|
|
21
21
|
from dbos._sys_db import GetWorkflowsInput
|
|
22
22
|
|
|
@@ -1208,6 +1208,20 @@ def test_destroy_semantics(dbos: DBOS, config: ConfigFile) -> None:
|
|
|
1208
1208
|
assert test_workflow(var) == var
|
|
1209
1209
|
|
|
1210
1210
|
|
|
1211
|
+
def test_double_decoration(dbos: DBOS) -> None:
|
|
1212
|
+
with pytest.raises(
|
|
1213
|
+
DBOSConflictingRegistrationError,
|
|
1214
|
+
match="is already registered with a conflicting function type",
|
|
1215
|
+
):
|
|
1216
|
+
|
|
1217
|
+
@DBOS.step()
|
|
1218
|
+
@DBOS.transaction()
|
|
1219
|
+
def my_function() -> None:
|
|
1220
|
+
pass
|
|
1221
|
+
|
|
1222
|
+
my_function()
|
|
1223
|
+
|
|
1224
|
+
|
|
1211
1225
|
def test_app_version(config: ConfigFile) -> None:
|
|
1212
1226
|
def is_hex(s: str) -> bool:
|
|
1213
1227
|
return all(c in "0123456789abcdefABCDEF" for c in s)
|
|
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
|
{dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/5c361fc04708_added_system_tables.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbos-0.22.0a9 → dbos-0.22.0a10}/dbos/_migrations/versions/d76646551a6b_job_queue_limiter.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
|
|
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
|