dbos 1.15.0a8__py3-none-any.whl → 2.0.0__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.
- dbos/_dbos.py +29 -1
- dbos/_sys_db.py +26 -0
- {dbos-1.15.0a8.dist-info → dbos-2.0.0.dist-info}/METADATA +1 -1
- {dbos-1.15.0a8.dist-info → dbos-2.0.0.dist-info}/RECORD +7 -7
- {dbos-1.15.0a8.dist-info → dbos-2.0.0.dist-info}/WHEEL +0 -0
- {dbos-1.15.0a8.dist-info → dbos-2.0.0.dist-info}/entry_points.txt +0 -0
- {dbos-1.15.0a8.dist-info → dbos-2.0.0.dist-info}/licenses/LICENSE +0 -0
dbos/_dbos.py
CHANGED
@@ -16,6 +16,7 @@ from typing import (
|
|
16
16
|
AsyncGenerator,
|
17
17
|
Callable,
|
18
18
|
Coroutine,
|
19
|
+
Dict,
|
19
20
|
Generator,
|
20
21
|
Generic,
|
21
22
|
List,
|
@@ -974,6 +975,33 @@ class DBOS:
|
|
974
975
|
lambda: DBOS.get_event(workflow_id, key, timeout_seconds)
|
975
976
|
)
|
976
977
|
|
978
|
+
@classmethod
|
979
|
+
def get_all_events(cls, workflow_id: str) -> Dict[str, Any]:
|
980
|
+
"""
|
981
|
+
Get all events currently present for a workflow ID.
|
982
|
+
Args:
|
983
|
+
workflow_id: The workflow ID for which to get events
|
984
|
+
Returns:
|
985
|
+
A dictionary mapping event keys to their deserialized values
|
986
|
+
"""
|
987
|
+
|
988
|
+
def fn() -> Dict[str, Any]:
|
989
|
+
return _get_dbos_instance()._sys_db.get_all_events(workflow_id)
|
990
|
+
|
991
|
+
return _get_dbos_instance()._sys_db.call_function_as_step(fn, "DBOS.get_events")
|
992
|
+
|
993
|
+
@classmethod
|
994
|
+
async def get_all_events_async(cls, workflow_id: str) -> Dict[str, Any]:
|
995
|
+
"""
|
996
|
+
Get all events currently present for a workflow ID.
|
997
|
+
Args:
|
998
|
+
workflow_id: The workflow ID for which to get events
|
999
|
+
Returns:
|
1000
|
+
A dictionary mapping event keys to their deserialized values
|
1001
|
+
"""
|
1002
|
+
await cls._configure_asyncio_thread_pool()
|
1003
|
+
return await asyncio.to_thread(cls.get_all_events, workflow_id)
|
1004
|
+
|
977
1005
|
@classmethod
|
978
1006
|
def _execute_workflow_id(cls, workflow_id: str) -> WorkflowHandle[Any]:
|
979
1007
|
"""Execute a workflow by ID (for recovery)."""
|
@@ -1225,7 +1253,7 @@ class DBOS:
|
|
1225
1253
|
async def list_workflow_steps_async(cls, workflow_id: str) -> List[StepInfo]:
|
1226
1254
|
await cls._configure_asyncio_thread_pool()
|
1227
1255
|
return await asyncio.to_thread(cls.list_workflow_steps, workflow_id)
|
1228
|
-
|
1256
|
+
|
1229
1257
|
@classproperty
|
1230
1258
|
def application_version(cls) -> str:
|
1231
1259
|
return GlobalParams.app_version
|
dbos/_sys_db.py
CHANGED
@@ -1567,6 +1567,32 @@ class SystemDatabase(ABC):
|
|
1567
1567
|
}
|
1568
1568
|
self._record_operation_result_txn(output, conn=c)
|
1569
1569
|
|
1570
|
+
def get_all_events(self, workflow_id: str) -> Dict[str, Any]:
|
1571
|
+
"""
|
1572
|
+
Get all events currently present for a workflow ID.
|
1573
|
+
|
1574
|
+
Args:
|
1575
|
+
workflow_id: The workflow UUID to get events for
|
1576
|
+
|
1577
|
+
Returns:
|
1578
|
+
A dictionary mapping event keys to their deserialized values
|
1579
|
+
"""
|
1580
|
+
with self.engine.begin() as c:
|
1581
|
+
rows = c.execute(
|
1582
|
+
sa.select(
|
1583
|
+
SystemSchema.workflow_events.c.key,
|
1584
|
+
SystemSchema.workflow_events.c.value,
|
1585
|
+
).where(SystemSchema.workflow_events.c.workflow_uuid == workflow_id)
|
1586
|
+
).fetchall()
|
1587
|
+
|
1588
|
+
events: Dict[str, Any] = {}
|
1589
|
+
for row in rows:
|
1590
|
+
key = row[0]
|
1591
|
+
value = _serialization.deserialize(row[1])
|
1592
|
+
events[key] = value
|
1593
|
+
|
1594
|
+
return events
|
1595
|
+
|
1570
1596
|
@db_retry()
|
1571
1597
|
def get_event(
|
1572
1598
|
self,
|
@@ -1,7 +1,7 @@
|
|
1
|
-
dbos-
|
2
|
-
dbos-
|
3
|
-
dbos-
|
4
|
-
dbos-
|
1
|
+
dbos-2.0.0.dist-info/METADATA,sha256=iI909H18rHrExRmKN1-N3VhzsxkcVem60bg22gBQKFo,14530
|
2
|
+
dbos-2.0.0.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
3
|
+
dbos-2.0.0.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
4
|
+
dbos-2.0.0.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
5
5
|
dbos/__init__.py,sha256=pT4BuNLDCrIQX27vQG8NlfxX6PZRU7r9miq4thJTszU,982
|
6
6
|
dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
|
7
7
|
dbos/_admin_server.py,sha256=hubQJw5T8zGKCPNS6FQTXy8jQ8GTJxoYQaDTMlICl9k,16267
|
@@ -13,7 +13,7 @@ dbos/_conductor/protocol.py,sha256=q3rgLxINFtWFigdOONc-4gX4vn66UmMlJQD6Kj8LnL4,7
|
|
13
13
|
dbos/_context.py,sha256=cJDxVbswTLXKE5MV4Hmg6gpIX3Dd5mBTG-4lmofWP9E,27668
|
14
14
|
dbos/_core.py,sha256=13DNN_fpSIs42NquV80XsHV7yKwY_adKP03h_xhXok4,50493
|
15
15
|
dbos/_croniter.py,sha256=XHAyUyibs_59sJQfSNWkP7rqQY6_XrlfuuCxk4jYqek,47559
|
16
|
-
dbos/_dbos.py,sha256=
|
16
|
+
dbos/_dbos.py,sha256=lkOnSZrEPkqURBJatBhnslHO0OKgmrS8rqLowEn5Rr0,58441
|
17
17
|
dbos/_dbos_config.py,sha256=4vgPyy4NiojAOiw3BnjWwiwT1_Ju3ZhXqJQOKDXhsE4,25148
|
18
18
|
dbos/_debouncer.py,sha256=9-9dlXKLRHSUSylprCw18r-7MAdFwD8-w0KkY-bEG_I,15281
|
19
19
|
dbos/_debug.py,sha256=0MfgNqutCUhI4PEmmra9x7f3DiFE_0nscfUCHdLimEY,1415
|
@@ -36,7 +36,7 @@ dbos/_schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
dbos/_schemas/application_database.py,sha256=SypAS9l9EsaBHFn9FR8jmnqt01M74d9AF1AMa4m2hhI,1040
|
37
37
|
dbos/_schemas/system_database.py,sha256=aEkjRQDh9xjdke0d9uFx_20-c9UjQtvuLtHZ24aOypA,5497
|
38
38
|
dbos/_serialization.py,sha256=GLgWLtHpvk7nSHyXukVQLE1ASNA3CJBtfF8w6iflBDw,3590
|
39
|
-
dbos/_sys_db.py,sha256=
|
39
|
+
dbos/_sys_db.py,sha256=lv7ahoD2E0eIzZCfaaHpDJ40XlJsbwPjEX_Sju3b9ew,84558
|
40
40
|
dbos/_sys_db_postgres.py,sha256=GuyGVyZZD_Wl7LjRSkHnOuZ-hOROlO4Xs2UeDhKq10E,6963
|
41
41
|
dbos/_sys_db_sqlite.py,sha256=ifjKdy-Z9vlVIBf5L6XnSaNjiBdvqPE73asVHim4A5Q,6998
|
42
42
|
dbos/_templates/dbos-db-starter/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
|
@@ -56,4 +56,4 @@ dbos/cli/migration.py,sha256=zJnDPUBnil5XZXFxc01EbZ0Radw_y8wtDGZExgelAxc,3633
|
|
56
56
|
dbos/dbos-config.schema.json,sha256=47wofTZ5jlFynec7bG0L369tAXbRQQ2euBxBXvg4m9c,1730
|
57
57
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
58
58
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
59
|
-
dbos-
|
59
|
+
dbos-2.0.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|