dbos 1.15.0a4__tar.gz → 1.15.0a5__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.

Files changed (99) hide show
  1. {dbos-1.15.0a4 → dbos-1.15.0a5}/PKG-INFO +1 -1
  2. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_dbos.py +4 -0
  3. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_debouncer.py +7 -5
  4. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_queue.py +2 -2
  5. {dbos-1.15.0a4 → dbos-1.15.0a5}/pyproject.toml +1 -1
  6. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_admin_server.py +4 -4
  7. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_client.py +6 -8
  8. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_dbos.py +6 -6
  9. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_debouncer.py +1 -1
  10. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_queue.py +4 -1
  11. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_spans.py +7 -7
  12. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_workflow_introspection.py +5 -5
  13. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_workflow_management.py +2 -5
  14. {dbos-1.15.0a4 → dbos-1.15.0a5}/LICENSE +0 -0
  15. {dbos-1.15.0a4 → dbos-1.15.0a5}/README.md +0 -0
  16. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/__init__.py +0 -0
  17. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/__main__.py +0 -0
  18. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_admin_server.py +0 -0
  19. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_app_db.py +0 -0
  20. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_classproperty.py +0 -0
  21. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_client.py +0 -0
  22. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_conductor/conductor.py +0 -0
  23. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_conductor/protocol.py +0 -0
  24. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_context.py +0 -0
  25. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_core.py +0 -0
  26. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_croniter.py +0 -0
  27. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_dbos_config.py +0 -0
  28. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_debug.py +0 -0
  29. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_docker_pg_helper.py +0 -0
  30. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_error.py +0 -0
  31. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_event_loop.py +0 -0
  32. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_fastapi.py +0 -0
  33. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_flask.py +0 -0
  34. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_kafka.py +0 -0
  35. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_kafka_message.py +0 -0
  36. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_logger.py +0 -0
  37. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_migration.py +0 -0
  38. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_outcome.py +0 -0
  39. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_recovery.py +0 -0
  40. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_registrations.py +0 -0
  41. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_roles.py +0 -0
  42. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_scheduler.py +0 -0
  43. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_schemas/__init__.py +0 -0
  44. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_schemas/application_database.py +0 -0
  45. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_schemas/system_database.py +0 -0
  46. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_serialization.py +0 -0
  47. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_sys_db.py +0 -0
  48. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_sys_db_postgres.py +0 -0
  49. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_sys_db_sqlite.py +0 -0
  50. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_templates/dbos-db-starter/README.md +0 -0
  51. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_templates/dbos-db-starter/__package/__init__.py +0 -0
  52. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_templates/dbos-db-starter/__package/main.py.dbos +0 -0
  53. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_templates/dbos-db-starter/__package/schema.py +0 -0
  54. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos +0 -0
  55. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_templates/dbos-db-starter/migrations/create_table.py.dbos +0 -0
  56. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_templates/dbos-db-starter/start_postgres_docker.py +0 -0
  57. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_tracer.py +0 -0
  58. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_utils.py +0 -0
  59. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/_workflow_commands.py +0 -0
  60. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/cli/_github_init.py +0 -0
  61. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/cli/_template_init.py +0 -0
  62. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/cli/cli.py +0 -0
  63. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/cli/migration.py +0 -0
  64. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/dbos-config.schema.json +0 -0
  65. {dbos-1.15.0a4 → dbos-1.15.0a5}/dbos/py.typed +0 -0
  66. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/__init__.py +0 -0
  67. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/atexit_no_ctor.py +0 -0
  68. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/atexit_no_launch.py +0 -0
  69. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/classdefs.py +0 -0
  70. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/client_collateral.py +0 -0
  71. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/client_worker.py +0 -0
  72. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/conftest.py +0 -0
  73. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/dupname_classdefs1.py +0 -0
  74. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/dupname_classdefsa.py +0 -0
  75. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/more_classdefs.py +0 -0
  76. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/queuedworkflow.py +0 -0
  77. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/script_without_fastapi.py +0 -0
  78. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_async.py +0 -0
  79. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_async_workflow_management.py +0 -0
  80. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_classdecorators.py +0 -0
  81. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_cli.py +0 -0
  82. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_concurrency.py +0 -0
  83. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_config.py +0 -0
  84. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_croniter.py +0 -0
  85. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_debug.py +0 -0
  86. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_docker_secrets.py +0 -0
  87. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_failures.py +0 -0
  88. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_fastapi.py +0 -0
  89. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_fastapi_roles.py +0 -0
  90. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_flask.py +0 -0
  91. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_kafka.py +0 -0
  92. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_outcome.py +0 -0
  93. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_package.py +0 -0
  94. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_scheduler.py +0 -0
  95. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_schema_migration.py +0 -0
  96. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_singleton.py +0 -0
  97. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_sqlalchemy.py +0 -0
  98. {dbos-1.15.0a4 → dbos-1.15.0a5}/tests/test_streaming.py +0 -0
  99. {dbos-1.15.0a4 → dbos-1.15.0a5}/version/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 1.15.0a4
3
+ Version: 1.15.0a5
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1222,6 +1222,10 @@ class DBOS:
1222
1222
  async def list_workflow_steps_async(cls, workflow_id: str) -> List[StepInfo]:
1223
1223
  await cls._configure_asyncio_thread_pool()
1224
1224
  return await asyncio.to_thread(cls.list_workflow_steps, workflow_id)
1225
+
1226
+ @classproperty
1227
+ def application_version(cls) -> str:
1228
+ return GlobalParams.app_version
1225
1229
 
1226
1230
  @classproperty
1227
1231
  def logger(cls) -> Logger:
@@ -89,11 +89,13 @@ def debouncer_workflow(
89
89
  # Every time the debounced workflow is called, a message is sent to this workflow.
90
90
  # It waits until debounce_period_sec have passed since the last message or until
91
91
  # debounce_timeout_sec has elapsed.
92
- debounce_deadline_epoch_sec = (
93
- time.time() + options["debounce_timeout_sec"]
94
- if options["debounce_timeout_sec"]
95
- else math.inf
96
- )
92
+ def get_debounce_deadline_epoch_sec() -> float:
93
+ return (
94
+ time.time() + options["debounce_timeout_sec"]
95
+ if options["debounce_timeout_sec"]
96
+ else math.inf
97
+ )
98
+ debounce_deadline_epoch_sec = dbos._sys_db.call_function_as_step(get_debounce_deadline_epoch_sec, "get_debounce_deadline_epoch_sec")
97
99
  debounce_period_sec = initial_debounce_period_sec
98
100
  while time.time() < debounce_deadline_epoch_sec:
99
101
  time_until_deadline = max(debounce_deadline_epoch_sec - time.time(), 0)
@@ -61,7 +61,7 @@ class Queue:
61
61
 
62
62
  registry = _get_or_create_dbos_registry()
63
63
  if self.name in registry.queue_info_map and self.name != INTERNAL_QUEUE_NAME:
64
- dbos_logger.warning(f"Queue {name} has already been declared")
64
+ raise Exception(f"Queue {name} has already been declared")
65
65
  registry.queue_info_map[self.name] = self
66
66
 
67
67
  def enqueue(
@@ -75,7 +75,7 @@ class Queue:
75
75
  and context.priority is not None
76
76
  and not self.priority_enabled
77
77
  ):
78
- dbos_logger.warning(
78
+ raise Exception(
79
79
  f"Priority is not enabled for queue {self.name}. Setting priority will not have any effect."
80
80
  )
81
81
 
@@ -15,7 +15,7 @@ dependencies = [
15
15
  ]
16
16
  requires-python = ">=3.10"
17
17
  readme = "README.md"
18
- version = "1.15.0a4"
18
+ version = "1.15.0a5"
19
19
 
20
20
  [project.license]
21
21
  text = "MIT"
@@ -520,7 +520,7 @@ def test_list_workflows(dbos: DBOS, skip_with_sqlite_imprecise_time: None) -> No
520
520
  assert workflows[0]["CreatedAt"] is not None and len(workflows[0]["CreatedAt"]) > 0
521
521
  assert workflows[0]["UpdatedAt"] is not None and len(workflows[0]["UpdatedAt"]) > 0
522
522
  assert workflows[0]["QueueName"] is None
523
- assert workflows[0]["ApplicationVersion"] == GlobalParams.app_version
523
+ assert workflows[0]["ApplicationVersion"] == DBOS.application_version
524
524
  assert workflows[0]["ExecutorID"] == GlobalParams.executor_id
525
525
 
526
526
  # Only load input and output as requested
@@ -620,7 +620,7 @@ def test_list_workflows(dbos: DBOS, skip_with_sqlite_imprecise_time: None) -> No
620
620
  assert len(workflows) == 2
621
621
 
622
622
  filters = {
623
- "application_version": GlobalParams.app_version,
623
+ "application_version": DBOS.application_version,
624
624
  }
625
625
  response = requests.post("http://localhost:3001/workflows", json=filters, timeout=5)
626
626
  assert response.status_code == 200
@@ -699,7 +699,7 @@ def test_get_workflow_by_id(dbos: DBOS) -> None:
699
699
  workflow_data["UpdatedAt"] is not None and len(workflow_data["UpdatedAt"]) > 0
700
700
  )
701
701
  assert workflow_data["QueueName"] is None
702
- assert workflow_data["ApplicationVersion"] == GlobalParams.app_version
702
+ assert workflow_data["ApplicationVersion"] == DBOS.application_version
703
703
  assert workflow_data["ExecutorID"] == GlobalParams.executor_id
704
704
 
705
705
  # Test GET /workflows/:workflow_id for a non-existing workflow
@@ -812,7 +812,7 @@ def test_queued_workflows_endpoint(
812
812
  and len(queued_workflows[0]["UpdatedAt"]) > 0
813
813
  )
814
814
  assert queued_workflows[0]["QueueName"] == test_queue1.name
815
- assert queued_workflows[0]["ApplicationVersion"] == GlobalParams.app_version
815
+ assert queued_workflows[0]["ApplicationVersion"] == DBOS.application_version
816
816
  assert queued_workflows[0]["ExecutorID"] == GlobalParams.executor_id
817
817
 
818
818
  # Verify sort_desc inverts the order
@@ -14,8 +14,6 @@ from sqlalchemy.exc import DBAPIError
14
14
 
15
15
  from dbos import DBOS, DBOSClient, DBOSConfig, EnqueueOptions, SetWorkflowID
16
16
  from dbos._dbos import WorkflowHandle, WorkflowHandleAsync
17
- from dbos._sys_db import SystemDatabase
18
- from dbos._utils import GlobalParams
19
17
  from tests import client_collateral
20
18
  from tests.client_collateral import event_test, retrieve_test, send_test
21
19
 
@@ -125,7 +123,7 @@ def test_client_enqueue_appver_not_set(dbos: DBOS, client: DBOSClient) -> None:
125
123
  assert wf_status is not None
126
124
  assert wf_status.status == "SUCCESS"
127
125
  assert wf_status.name == "enqueue_test"
128
- assert wf_status.app_version == GlobalParams.app_version
126
+ assert wf_status.app_version == DBOS.application_version
129
127
 
130
128
 
131
129
  def test_client_enqueue_appver_set(dbos: DBOS, client: DBOSClient) -> None:
@@ -138,7 +136,7 @@ def test_client_enqueue_appver_set(dbos: DBOS, client: DBOSClient) -> None:
138
136
  "queue_name": "test_queue",
139
137
  "workflow_name": "enqueue_test",
140
138
  "workflow_id": wfid,
141
- "app_version": GlobalParams.app_version,
139
+ "app_version": DBOS.application_version,
142
140
  }
143
141
 
144
142
  client.enqueue(options, 42, "test", johnDoe)
@@ -151,7 +149,7 @@ def test_client_enqueue_appver_set(dbos: DBOS, client: DBOSClient) -> None:
151
149
  assert wf_status is not None
152
150
  assert wf_status.status == "SUCCESS"
153
151
  assert wf_status.name == "enqueue_test"
154
- assert wf_status.app_version == GlobalParams.app_version
152
+ assert wf_status.app_version == DBOS.application_version
155
153
 
156
154
 
157
155
  def test_client_enqueue_wrong_appver(dbos: DBOS, client: DBOSClient) -> None:
@@ -205,7 +203,7 @@ def test_client_enqueue_idempotent(config: DBOSConfig, client: DBOSClient) -> No
205
203
  assert wf_status is not None
206
204
  assert wf_status.status == "SUCCESS"
207
205
  assert wf_status.name == "enqueue_test"
208
- assert wf_status.app_version == GlobalParams.app_version
206
+ assert wf_status.app_version == DBOS.application_version
209
207
 
210
208
  DBOS.destroy(destroy_registry=True)
211
209
 
@@ -272,7 +270,7 @@ def test_client_send_idempotent(
272
270
  idempotency_key = f"test-idempotency-{now}"
273
271
  sendWFID = f"{wfid}-{idempotency_key}"
274
272
 
275
- run_send_worker(wfid, topic, GlobalParams.app_version)
273
+ run_send_worker(wfid, topic, DBOS.application_version)
276
274
 
277
275
  client.send(wfid, message, topic, idempotency_key)
278
276
  client.send(wfid, message, topic, idempotency_key)
@@ -315,7 +313,7 @@ def test_client_send_failure(
315
313
  idempotency_key = f"test-idempotency-{now}"
316
314
  sendWFID = f"{wfid}-{idempotency_key}"
317
315
 
318
- run_send_worker(wfid, topic, GlobalParams.app_version)
316
+ run_send_worker(wfid, topic, DBOS.application_version)
319
317
 
320
318
  client.send(wfid, message, topic, idempotency_key)
321
319
 
@@ -1371,12 +1371,12 @@ def test_app_version(config: DBOSConfig) -> None:
1371
1371
  DBOS.launch()
1372
1372
 
1373
1373
  # Verify that app version is correctly set to a hex string
1374
- app_version = GlobalParams.app_version
1374
+ app_version = DBOS.application_version
1375
1375
  assert len(app_version) > 0
1376
1376
  assert is_hex(app_version)
1377
1377
 
1378
1378
  DBOS.destroy(destroy_registry=True)
1379
- assert GlobalParams.app_version == ""
1379
+ assert DBOS.application_version == ""
1380
1380
  dbos = DBOS(config=config)
1381
1381
 
1382
1382
  @DBOS.workflow()
@@ -1390,7 +1390,7 @@ def test_app_version(config: DBOSConfig) -> None:
1390
1390
  DBOS.launch()
1391
1391
 
1392
1392
  # Verify stability--the same workflow source produces the same app version.
1393
- assert GlobalParams.app_version == app_version
1393
+ assert DBOS.application_version == app_version
1394
1394
 
1395
1395
  DBOS.destroy(destroy_registry=True)
1396
1396
  dbos = DBOS(config=config)
@@ -1401,7 +1401,7 @@ def test_app_version(config: DBOSConfig) -> None:
1401
1401
 
1402
1402
  # Verify that changing the workflow source changes the workflow version
1403
1403
  DBOS.launch()
1404
- assert GlobalParams.app_version != app_version
1404
+ assert DBOS.application_version != app_version
1405
1405
 
1406
1406
  # Verify that version can be overriden with an environment variable
1407
1407
  app_version = str(uuid.uuid4())
@@ -1415,7 +1415,7 @@ def test_app_version(config: DBOSConfig) -> None:
1415
1415
  return x
1416
1416
 
1417
1417
  DBOS.launch()
1418
- assert GlobalParams.app_version == app_version
1418
+ assert DBOS.application_version == app_version
1419
1419
 
1420
1420
  del os.environ["DBOS__APPVERSION"]
1421
1421
 
@@ -1434,7 +1434,7 @@ def test_app_version(config: DBOSConfig) -> None:
1434
1434
  return DBOS.workflow_id
1435
1435
 
1436
1436
  DBOS.launch()
1437
- assert GlobalParams.app_version == app_version
1437
+ assert DBOS.application_version == app_version
1438
1438
  assert GlobalParams.executor_id == executor_id
1439
1439
  wfid = test_workflow()
1440
1440
  handle: WorkflowHandle[str] = DBOS.retrieve_workflow(wfid)
@@ -147,7 +147,7 @@ def test_debouncer_queue(dbos: DBOS) -> None:
147
147
  return x
148
148
 
149
149
  first_value, second_value, third_value, fourth_value = 0, 1, 2, 3
150
- queue = Queue("test-queue")
150
+ queue = Queue("test-queue", priority_enabled=True)
151
151
 
152
152
  debouncer = Debouncer.create(workflow, queue=queue)
153
153
  debounce_period_sec = 2
@@ -55,6 +55,10 @@ def test_simple_queue(dbos: DBOS) -> None:
55
55
 
56
56
  queue = Queue("test_queue")
57
57
 
58
+ # Test that redeclaring a queue is an exception
59
+ with pytest.raises(Exception):
60
+ Queue(queue.name)
61
+
58
62
  with SetWorkflowID(wfid):
59
63
  handle = queue.enqueue(test_workflow, "abc", "123")
60
64
  assert handle.get_result() == "abcd123"
@@ -908,7 +912,6 @@ def test_timeout_queue(dbos: DBOS) -> None:
908
912
 
909
913
  # Verify if a parent called with a timeout enqueues a blocked child
910
914
  # then exits the deadline propagates and the child is cancelled.
911
- queue = Queue("regular_queue")
912
915
 
913
916
  @DBOS.workflow()
914
917
  def exiting_parent_workflow() -> str:
@@ -76,7 +76,7 @@ def test_spans(config: DBOSConfig) -> None:
76
76
  for log in logs:
77
77
  assert log.log_record.attributes is not None
78
78
  assert (
79
- log.log_record.attributes["applicationVersion"] == GlobalParams.app_version
79
+ log.log_record.attributes["applicationVersion"] == DBOS.application_version
80
80
  )
81
81
  assert log.log_record.attributes["executorID"] == GlobalParams.executor_id
82
82
  assert log.log_record.attributes["foo"] == "bar"
@@ -98,7 +98,7 @@ def test_spans(config: DBOSConfig) -> None:
98
98
  # Skip the manual span because it was not created by DBOS.tracer
99
99
  continue
100
100
  assert span.attributes is not None
101
- assert span.attributes["applicationVersion"] == GlobalParams.app_version
101
+ assert span.attributes["applicationVersion"] == DBOS.application_version
102
102
  assert span.attributes["executorID"] == GlobalParams.executor_id
103
103
  assert span.context is not None
104
104
  assert span.attributes["foo"] == "bar"
@@ -203,7 +203,7 @@ async def test_spans_async(dbos: DBOS) -> None:
203
203
  for log in logs:
204
204
  assert log.log_record.attributes is not None
205
205
  assert (
206
- log.log_record.attributes["applicationVersion"] == GlobalParams.app_version
206
+ log.log_record.attributes["applicationVersion"] == DBOS.application_version
207
207
  )
208
208
  assert log.log_record.attributes["executorID"] == GlobalParams.executor_id
209
209
  # Make sure the log record has a span_id and trace_id
@@ -226,7 +226,7 @@ async def test_spans_async(dbos: DBOS) -> None:
226
226
  # Skip the manual span because it was not created by DBOS.tracer
227
227
  continue
228
228
  assert span.attributes is not None
229
- assert span.attributes["applicationVersion"] == GlobalParams.app_version
229
+ assert span.attributes["applicationVersion"] == DBOS.application_version
230
230
  assert span.attributes["executorID"] == GlobalParams.executor_id
231
231
  assert span.context is not None
232
232
  assert span.context.span_id > 0
@@ -316,7 +316,7 @@ def test_wf_fastapi(dbos_fastapi: Tuple[DBOS, FastAPI]) -> None:
316
316
  assert len(logs) == 1
317
317
  assert logs[0].log_record.attributes is not None
318
318
  assert (
319
- logs[0].log_record.attributes["applicationVersion"] == GlobalParams.app_version
319
+ logs[0].log_record.attributes["applicationVersion"] == DBOS.application_version
320
320
  )
321
321
  assert logs[0].log_record.span_id is not None and logs[0].log_record.span_id > 0
322
322
  assert logs[0].log_record.trace_id is not None and logs[0].log_record.trace_id > 0
@@ -331,7 +331,7 @@ def test_wf_fastapi(dbos_fastapi: Tuple[DBOS, FastAPI]) -> None:
331
331
 
332
332
  for span in spans:
333
333
  assert span.attributes is not None
334
- assert span.attributes["applicationVersion"] == GlobalParams.app_version
334
+ assert span.attributes["applicationVersion"] == DBOS.application_version
335
335
  assert span.context is not None
336
336
  assert span.context.span_id > 0
337
337
  assert span.context.trace_id > 0
@@ -389,7 +389,7 @@ def test_disable_otlp_no_spans(config: DBOSConfig) -> None:
389
389
  for log in logs:
390
390
  assert log.log_record.attributes is not None
391
391
  assert (
392
- log.log_record.attributes["applicationVersion"] == GlobalParams.app_version
392
+ log.log_record.attributes["applicationVersion"] == DBOS.application_version
393
393
  )
394
394
  assert log.log_record.attributes["executorID"] == GlobalParams.executor_id
395
395
  assert log.log_record.attributes["foo"] == "bar"
@@ -39,7 +39,7 @@ def test_list_workflow(dbos: DBOS) -> None:
39
39
  assert output.updated_at is not None and output.updated_at > 0
40
40
  assert output.queue_name == None
41
41
  assert output.executor_id == GlobalParams.executor_id
42
- assert output.app_version == GlobalParams.app_version
42
+ assert output.app_version == DBOS.application_version
43
43
  assert output.app_id == ""
44
44
  assert output.recovery_attempts == 1
45
45
  assert output.workflow_timeout_ms is None
@@ -77,7 +77,7 @@ def test_list_workflow(dbos: DBOS) -> None:
77
77
  # Test searching by application version
78
78
  outputs = DBOS.list_workflows(app_version="no")
79
79
  assert len(outputs) == 0
80
- outputs = DBOS.list_workflows(app_version=GlobalParams.app_version)
80
+ outputs = DBOS.list_workflows(app_version=DBOS.application_version)
81
81
  assert len(outputs) == 1
82
82
 
83
83
 
@@ -109,7 +109,7 @@ def test_list_workflow_error(dbos: DBOS) -> None:
109
109
  assert output.updated_at is not None and output.updated_at > 0
110
110
  assert output.queue_name == None
111
111
  assert output.executor_id == GlobalParams.executor_id
112
- assert output.app_version == GlobalParams.app_version
112
+ assert output.app_version == DBOS.application_version
113
113
  assert output.app_id == ""
114
114
  assert output.recovery_attempts == 1
115
115
  assert output.workflow_timeout_ms is None
@@ -289,7 +289,7 @@ def test_queued_workflows(dbos: DBOS, skip_with_sqlite_imprecise_time: None) ->
289
289
  assert workflow.error is None
290
290
  assert "blocking_step" in workflow.name
291
291
  assert workflow.executor_id == GlobalParams.executor_id
292
- assert workflow.app_version == GlobalParams.app_version
292
+ assert workflow.app_version == DBOS.application_version
293
293
  assert workflow.created_at is not None and workflow.created_at > 0
294
294
  assert workflow.updated_at is not None and workflow.updated_at > 0
295
295
  assert workflow.recovery_attempts == 1
@@ -323,7 +323,7 @@ def test_queued_workflows(dbos: DBOS, skip_with_sqlite_imprecise_time: None) ->
323
323
  assert workflow.error is None
324
324
  assert "blocking_step" in workflow.name
325
325
  assert workflow.executor_id == GlobalParams.executor_id
326
- assert workflow.app_version == GlobalParams.app_version
326
+ assert workflow.app_version == DBOS.application_version
327
327
  assert workflow.created_at is not None and workflow.created_at > 0
328
328
  assert workflow.updated_at is not None and workflow.updated_at > 0
329
329
  assert workflow.recovery_attempts == 1
@@ -1,14 +1,11 @@
1
1
  import threading
2
2
  import time
3
3
  import uuid
4
- from typing import Callable
5
4
 
6
5
  import pytest
7
6
  import sqlalchemy as sa
8
7
 
9
- # Public API
10
8
  from dbos import DBOS, Queue, SetWorkflowID
11
- from dbos._dbos import DBOSConfiguredInstance
12
9
  from dbos._error import DBOSAwaitedWorkflowCancelledError
13
10
  from dbos._schemas.application_database import ApplicationSchema
14
11
  from dbos._utils import INTERNAL_QUEUE_NAME, GlobalParams
@@ -58,7 +55,7 @@ def test_cancel_resume(dbos: DBOS) -> None:
58
55
 
59
56
  # Resume the workflow. Verify it completes successfully.
60
57
  handle = DBOS.resume_workflow(wfid)
61
- assert handle.get_status().app_version == GlobalParams.app_version
58
+ assert handle.get_status().app_version == DBOS.application_version
62
59
  assert handle.get_status().queue_name == INTERNAL_QUEUE_NAME
63
60
  assert handle.get_result() == input
64
61
  assert steps_completed == 2
@@ -231,7 +228,7 @@ def test_fork_steps(
231
228
  with SetWorkflowID(fork_id):
232
229
  forked_handle = DBOS.fork_workflow(wfid, 3)
233
230
  assert forked_handle.workflow_id == fork_id
234
- assert forked_handle.get_status().app_version == GlobalParams.app_version
231
+ assert forked_handle.get_status().app_version == DBOS.application_version
235
232
  assert forked_handle.get_result() == output
236
233
 
237
234
  assert stepOneCount == 1
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