dbos 1.15.0a9__tar.gz → 2.1.0a1__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.
- {dbos-1.15.0a9 → dbos-2.1.0a1}/PKG-INFO +1 -1
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_debouncer.py +5 -1
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_sys_db.py +13 -14
- {dbos-1.15.0a9 → dbos-2.1.0a1}/pyproject.toml +1 -1
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_failures.py +31 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/LICENSE +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/README.md +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/__init__.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/__main__.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_admin_server.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_app_db.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_classproperty.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_client.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_conductor/conductor.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_conductor/protocol.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_context.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_core.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_croniter.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_dbos.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_dbos_config.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_debug.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_docker_pg_helper.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_error.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_event_loop.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_fastapi.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_flask.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_kafka.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_kafka_message.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_logger.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_migration.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_outcome.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_queue.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_recovery.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_registrations.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_roles.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_scheduler.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_schemas/__init__.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_schemas/application_database.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_schemas/system_database.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_serialization.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_sys_db_postgres.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_sys_db_sqlite.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/README.md +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/__package/__init__.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/__package/main.py.dbos +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/__package/schema.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/migrations/create_table.py.dbos +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/start_postgres_docker.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_tracer.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_utils.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_workflow_commands.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/cli/_github_init.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/cli/_template_init.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/cli/cli.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/cli/migration.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/dbos-config.schema.json +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/py.typed +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/__init__.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/atexit_no_ctor.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/atexit_no_launch.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/classdefs.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/client_collateral.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/client_worker.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/conftest.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/dupname_classdefs1.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/dupname_classdefsa.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/more_classdefs.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/queuedworkflow.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/script_without_fastapi.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_admin_server.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_async.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_async_workflow_management.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_classdecorators.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_cli.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_client.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_concurrency.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_config.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_croniter.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_dbos.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_debouncer.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_debug.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_docker_secrets.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_fastapi.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_fastapi_roles.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_flask.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_kafka.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_outcome.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_package.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_queue.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_scheduler.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_schema_migration.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_singleton.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_spans.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_sqlalchemy.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_streaming.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_workflow_introspection.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/tests/test_workflow_management.py +0 -0
- {dbos-1.15.0a9 → dbos-2.1.0a1}/version/__init__.py +0 -0
@@ -86,6 +86,7 @@ def debouncer_workflow(
|
|
86
86
|
dbos = _get_dbos_instance()
|
87
87
|
|
88
88
|
workflow_inputs: WorkflowInputs = {"args": args, "kwargs": kwargs}
|
89
|
+
|
89
90
|
# Every time the debounced workflow is called, a message is sent to this workflow.
|
90
91
|
# It waits until debounce_period_sec have passed since the last message or until
|
91
92
|
# debounce_timeout_sec has elapsed.
|
@@ -95,7 +96,10 @@ def debouncer_workflow(
|
|
95
96
|
if options["debounce_timeout_sec"]
|
96
97
|
else math.inf
|
97
98
|
)
|
98
|
-
|
99
|
+
|
100
|
+
debounce_deadline_epoch_sec = dbos._sys_db.call_function_as_step(
|
101
|
+
get_debounce_deadline_epoch_sec, "get_debounce_deadline_epoch_sec"
|
102
|
+
)
|
99
103
|
debounce_period_sec = initial_debounce_period_sec
|
100
104
|
while time.time() < debounce_deadline_epoch_sec:
|
101
105
|
time_until_deadline = max(debounce_deadline_epoch_sec - time.time(), 0)
|
@@ -1077,24 +1077,23 @@ class SystemDatabase(ABC):
|
|
1077
1077
|
SystemSchema.operation_outputs.c.child_workflow_id,
|
1078
1078
|
).where(SystemSchema.operation_outputs.c.workflow_uuid == workflow_id)
|
1079
1079
|
).fetchall()
|
1080
|
-
|
1081
|
-
|
1080
|
+
steps = []
|
1081
|
+
for row in rows:
|
1082
|
+
_, output, exception = _serialization.safe_deserialize(
|
1083
|
+
workflow_id,
|
1084
|
+
serialized_input=None,
|
1085
|
+
serialized_output=row[2],
|
1086
|
+
serialized_exception=row[3],
|
1087
|
+
)
|
1088
|
+
step = StepInfo(
|
1082
1089
|
function_id=row[0],
|
1083
1090
|
function_name=row[1],
|
1084
|
-
output=
|
1085
|
-
|
1086
|
-
if row[2] is not None
|
1087
|
-
else row[2]
|
1088
|
-
),
|
1089
|
-
error=(
|
1090
|
-
_serialization.deserialize_exception(row[3])
|
1091
|
-
if row[3] is not None
|
1092
|
-
else row[3]
|
1093
|
-
),
|
1091
|
+
output=output,
|
1092
|
+
error=exception,
|
1094
1093
|
child_workflow_id=row[4],
|
1095
1094
|
)
|
1096
|
-
|
1097
|
-
|
1095
|
+
steps.append(step)
|
1096
|
+
return steps
|
1098
1097
|
|
1099
1098
|
def _record_operation_result_txn(
|
1100
1099
|
self, result: OperationResultInternal, conn: sa.Connection
|
@@ -9,6 +9,7 @@ from psycopg.errors import SerializationFailure
|
|
9
9
|
from sqlalchemy.exc import InvalidRequestError, OperationalError
|
10
10
|
|
11
11
|
from dbos import DBOS, Queue, SetWorkflowID
|
12
|
+
from dbos._client import DBOSClient
|
12
13
|
from dbos._dbos_config import DBOSConfig
|
13
14
|
from dbos._error import (
|
14
15
|
DBOSAwaitedWorkflowCancelledError,
|
@@ -502,6 +503,36 @@ def test_error_serialization() -> None:
|
|
502
503
|
assert isinstance(exception, str)
|
503
504
|
|
504
505
|
|
506
|
+
def test_workflow_error_serialization(dbos: DBOS, client: DBOSClient) -> None:
|
507
|
+
|
508
|
+
@DBOS.step()
|
509
|
+
def step() -> None:
|
510
|
+
raise BadException(1, 2)
|
511
|
+
|
512
|
+
@DBOS.workflow()
|
513
|
+
def workflow() -> None:
|
514
|
+
step()
|
515
|
+
|
516
|
+
handle = DBOS.start_workflow(workflow)
|
517
|
+
|
518
|
+
with pytest.raises(BadException):
|
519
|
+
handle.get_result()
|
520
|
+
|
521
|
+
workflows = DBOS.list_workflows()
|
522
|
+
assert len(workflows) == 1
|
523
|
+
assert workflows[0].error is not None
|
524
|
+
|
525
|
+
steps = DBOS.list_workflow_steps(handle.workflow_id)
|
526
|
+
assert len(steps) == 1
|
527
|
+
assert steps[0]["error"] is not None
|
528
|
+
|
529
|
+
status = handle.get_status()
|
530
|
+
assert status.error is not None
|
531
|
+
|
532
|
+
status = client.retrieve_workflow(handle.workflow_id).get_status()
|
533
|
+
assert status.error is not None
|
534
|
+
|
535
|
+
|
505
536
|
def test_unregistered_workflow(dbos: DBOS, config: DBOSConfig) -> None:
|
506
537
|
|
507
538
|
@DBOS.workflow()
|
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
|
{dbos-1.15.0a9 → dbos-2.1.0a1}/dbos/_templates/dbos-db-starter/migrations/create_table.py.dbos
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
|