dbos 2.1.0a2__py3-none-any.whl → 2.2.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/__init__.py +2 -0
- dbos/_app_db.py +40 -45
- dbos/_client.py +11 -4
- dbos/_context.py +8 -0
- dbos/_core.py +38 -26
- dbos/_dbos.py +15 -0
- dbos/_dbos_config.py +4 -10
- dbos/_migration.py +12 -2
- dbos/_queue.py +29 -4
- dbos/_scheduler.py +24 -14
- dbos/_schemas/system_database.py +1 -0
- dbos/_serialization.py +24 -36
- dbos/_sys_db.py +124 -60
- dbos/cli/migration.py +3 -0
- {dbos-2.1.0a2.dist-info → dbos-2.2.0.dist-info}/METADATA +1 -1
- {dbos-2.1.0a2.dist-info → dbos-2.2.0.dist-info}/RECORD +19 -19
- {dbos-2.1.0a2.dist-info → dbos-2.2.0.dist-info}/WHEEL +0 -0
- {dbos-2.1.0a2.dist-info → dbos-2.2.0.dist-info}/entry_points.txt +0 -0
- {dbos-2.1.0a2.dist-info → dbos-2.2.0.dist-info}/licenses/LICENSE +0 -0
dbos/_sys_db.py
CHANGED
@@ -30,7 +30,6 @@ from dbos._utils import (
|
|
30
30
|
retriable_sqlite_exception,
|
31
31
|
)
|
32
32
|
|
33
|
-
from . import _serialization
|
34
33
|
from ._context import get_local_dbos_context
|
35
34
|
from ._error import (
|
36
35
|
DBOSAwaitedWorkflowCancelledError,
|
@@ -44,6 +43,7 @@ from ._error import (
|
|
44
43
|
)
|
45
44
|
from ._logger import dbos_logger
|
46
45
|
from ._schemas.system_database import SystemSchema
|
46
|
+
from ._serialization import Serializer, WorkflowInputs, safe_deserialize
|
47
47
|
|
48
48
|
if TYPE_CHECKING:
|
49
49
|
from ._queue import Queue
|
@@ -95,7 +95,7 @@ class WorkflowStatus:
|
|
95
95
|
# All roles which the authenticated user could assume
|
96
96
|
authenticated_roles: Optional[list[str]]
|
97
97
|
# The deserialized workflow input object
|
98
|
-
input: Optional[
|
98
|
+
input: Optional[WorkflowInputs]
|
99
99
|
# The workflow's output, if any
|
100
100
|
output: Optional[Any] = None
|
101
101
|
# The error the workflow threw, if any
|
@@ -152,6 +152,8 @@ class WorkflowStatusInternal(TypedDict):
|
|
152
152
|
priority: int
|
153
153
|
# Serialized workflow inputs
|
154
154
|
inputs: str
|
155
|
+
# If this workflow is enqueued on a partitioned queue, its partition key
|
156
|
+
queue_partition_key: Optional[str]
|
155
157
|
|
156
158
|
|
157
159
|
class EnqueueOptionsInternal(TypedDict):
|
@@ -161,6 +163,8 @@ class EnqueueOptionsInternal(TypedDict):
|
|
161
163
|
priority: Optional[int]
|
162
164
|
# On what version the workflow is enqueued. Current version if not specified.
|
163
165
|
app_version: Optional[str]
|
166
|
+
# If the workflow is enqueued on a partitioned queue, its partition key
|
167
|
+
queue_partition_key: Optional[str]
|
164
168
|
|
165
169
|
|
166
170
|
class RecordedResult(TypedDict):
|
@@ -341,6 +345,39 @@ def db_retry(
|
|
341
345
|
|
342
346
|
class SystemDatabase(ABC):
|
343
347
|
|
348
|
+
@staticmethod
|
349
|
+
def create(
|
350
|
+
system_database_url: str,
|
351
|
+
engine_kwargs: Dict[str, Any],
|
352
|
+
engine: Optional[sa.Engine],
|
353
|
+
schema: Optional[str],
|
354
|
+
serializer: Serializer,
|
355
|
+
debug_mode: bool = False,
|
356
|
+
) -> "SystemDatabase":
|
357
|
+
"""Factory method to create the appropriate SystemDatabase implementation based on URL."""
|
358
|
+
if system_database_url.startswith("sqlite"):
|
359
|
+
from ._sys_db_sqlite import SQLiteSystemDatabase
|
360
|
+
|
361
|
+
return SQLiteSystemDatabase(
|
362
|
+
system_database_url=system_database_url,
|
363
|
+
engine_kwargs=engine_kwargs,
|
364
|
+
engine=engine,
|
365
|
+
schema=schema,
|
366
|
+
serializer=serializer,
|
367
|
+
debug_mode=debug_mode,
|
368
|
+
)
|
369
|
+
else:
|
370
|
+
from ._sys_db_postgres import PostgresSystemDatabase
|
371
|
+
|
372
|
+
return PostgresSystemDatabase(
|
373
|
+
system_database_url=system_database_url,
|
374
|
+
engine_kwargs=engine_kwargs,
|
375
|
+
engine=engine,
|
376
|
+
schema=schema,
|
377
|
+
serializer=serializer,
|
378
|
+
debug_mode=debug_mode,
|
379
|
+
)
|
380
|
+
|
344
381
|
def __init__(
|
345
382
|
self,
|
346
383
|
*,
|
@@ -348,6 +385,7 @@ class SystemDatabase(ABC):
|
|
348
385
|
engine_kwargs: Dict[str, Any],
|
349
386
|
engine: Optional[sa.Engine],
|
350
387
|
schema: Optional[str],
|
388
|
+
serializer: Serializer,
|
351
389
|
debug_mode: bool = False,
|
352
390
|
):
|
353
391
|
import sqlalchemy.dialects.postgresql as pg
|
@@ -355,6 +393,8 @@ class SystemDatabase(ABC):
|
|
355
393
|
|
356
394
|
self.dialect = sq if system_database_url.startswith("sqlite") else pg
|
357
395
|
|
396
|
+
self.serializer = serializer
|
397
|
+
|
358
398
|
if system_database_url.startswith("sqlite"):
|
359
399
|
self.schema = None
|
360
400
|
else:
|
@@ -454,6 +494,7 @@ class SystemDatabase(ABC):
|
|
454
494
|
deduplication_id=status["deduplication_id"],
|
455
495
|
priority=status["priority"],
|
456
496
|
inputs=status["inputs"],
|
497
|
+
queue_partition_key=status["queue_partition_key"],
|
457
498
|
)
|
458
499
|
.on_conflict_do_update(
|
459
500
|
index_elements=["workflow_uuid"],
|
@@ -725,6 +766,7 @@ class SystemDatabase(ABC):
|
|
725
766
|
SystemSchema.workflow_status.c.deduplication_id,
|
726
767
|
SystemSchema.workflow_status.c.priority,
|
727
768
|
SystemSchema.workflow_status.c.inputs,
|
769
|
+
SystemSchema.workflow_status.c.queue_partition_key,
|
728
770
|
).where(SystemSchema.workflow_status.c.workflow_uuid == workflow_uuid)
|
729
771
|
).fetchone()
|
730
772
|
if row is None:
|
@@ -752,6 +794,7 @@ class SystemDatabase(ABC):
|
|
752
794
|
"deduplication_id": row[16],
|
753
795
|
"priority": row[17],
|
754
796
|
"inputs": row[18],
|
797
|
+
"queue_partition_key": row[19],
|
755
798
|
}
|
756
799
|
return status
|
757
800
|
|
@@ -797,10 +840,11 @@ class SystemDatabase(ABC):
|
|
797
840
|
status = row[0]
|
798
841
|
if status == WorkflowStatusString.SUCCESS.value:
|
799
842
|
output = row[1]
|
800
|
-
return
|
843
|
+
return self.serializer.deserialize(output)
|
801
844
|
elif status == WorkflowStatusString.ERROR.value:
|
802
845
|
error = row[2]
|
803
|
-
|
846
|
+
e: Exception = self.serializer.deserialize(error)
|
847
|
+
raise e
|
804
848
|
elif status == WorkflowStatusString.CANCELLED.value:
|
805
849
|
# Raise AwaitedWorkflowCancelledError here, not the cancellation exception
|
806
850
|
# because the awaiting workflow is not being cancelled.
|
@@ -917,7 +961,8 @@ class SystemDatabase(ABC):
|
|
917
961
|
raw_input = row[17] if load_input else None
|
918
962
|
raw_output = row[18] if load_output else None
|
919
963
|
raw_error = row[19] if load_output else None
|
920
|
-
inputs, output, exception =
|
964
|
+
inputs, output, exception = safe_deserialize(
|
965
|
+
self.serializer,
|
921
966
|
info.workflow_id,
|
922
967
|
serialized_input=raw_input,
|
923
968
|
serialized_output=raw_output,
|
@@ -1028,7 +1073,8 @@ class SystemDatabase(ABC):
|
|
1028
1073
|
raw_input = row[17] if load_input else None
|
1029
1074
|
|
1030
1075
|
# Error and Output are not loaded because they should always be None for queued workflows.
|
1031
|
-
inputs, output, exception =
|
1076
|
+
inputs, output, exception = safe_deserialize(
|
1077
|
+
self.serializer,
|
1032
1078
|
info.workflow_id,
|
1033
1079
|
serialized_input=raw_input,
|
1034
1080
|
serialized_output=None,
|
@@ -1079,7 +1125,8 @@ class SystemDatabase(ABC):
|
|
1079
1125
|
).fetchall()
|
1080
1126
|
steps = []
|
1081
1127
|
for row in rows:
|
1082
|
-
_, output, exception =
|
1128
|
+
_, output, exception = safe_deserialize(
|
1129
|
+
self.serializer,
|
1083
1130
|
workflow_id,
|
1084
1131
|
serialized_input=None,
|
1085
1132
|
serialized_output=row[2],
|
@@ -1278,7 +1325,8 @@ class SystemDatabase(ABC):
|
|
1278
1325
|
if row is None:
|
1279
1326
|
return None
|
1280
1327
|
elif row[1]:
|
1281
|
-
|
1328
|
+
e: Exception = self.serializer.deserialize(row[1])
|
1329
|
+
raise e
|
1282
1330
|
else:
|
1283
1331
|
return str(row[0])
|
1284
1332
|
|
@@ -1317,7 +1365,7 @@ class SystemDatabase(ABC):
|
|
1317
1365
|
sa.insert(SystemSchema.notifications).values(
|
1318
1366
|
destination_uuid=destination_uuid,
|
1319
1367
|
topic=topic,
|
1320
|
-
message=
|
1368
|
+
message=self.serializer.serialize(message),
|
1321
1369
|
)
|
1322
1370
|
)
|
1323
1371
|
except DBAPIError as dbapi_error:
|
@@ -1354,7 +1402,7 @@ class SystemDatabase(ABC):
|
|
1354
1402
|
if recorded_output is not None:
|
1355
1403
|
dbos_logger.debug(f"Replaying recv, id: {function_id}, topic: {topic}")
|
1356
1404
|
if recorded_output["output"] is not None:
|
1357
|
-
return
|
1405
|
+
return self.serializer.deserialize(recorded_output["output"])
|
1358
1406
|
else:
|
1359
1407
|
raise Exception("No output recorded in the last recv")
|
1360
1408
|
else:
|
@@ -1421,13 +1469,13 @@ class SystemDatabase(ABC):
|
|
1421
1469
|
rows = c.execute(delete_stmt).fetchall()
|
1422
1470
|
message: Any = None
|
1423
1471
|
if len(rows) > 0:
|
1424
|
-
message =
|
1472
|
+
message = self.serializer.deserialize(rows[0][0])
|
1425
1473
|
self._record_operation_result_txn(
|
1426
1474
|
{
|
1427
1475
|
"workflow_uuid": workflow_uuid,
|
1428
1476
|
"function_id": function_id,
|
1429
1477
|
"function_name": function_name,
|
1430
|
-
"output":
|
1478
|
+
"output": self.serializer.serialize(
|
1431
1479
|
message
|
1432
1480
|
), # None will be serialized to 'null'
|
1433
1481
|
"error": None,
|
@@ -1453,36 +1501,6 @@ class SystemDatabase(ABC):
|
|
1453
1501
|
|
1454
1502
|
PostgresSystemDatabase._reset_system_database(database_url)
|
1455
1503
|
|
1456
|
-
@staticmethod
|
1457
|
-
def create(
|
1458
|
-
system_database_url: str,
|
1459
|
-
engine_kwargs: Dict[str, Any],
|
1460
|
-
engine: Optional[sa.Engine],
|
1461
|
-
schema: Optional[str],
|
1462
|
-
debug_mode: bool = False,
|
1463
|
-
) -> "SystemDatabase":
|
1464
|
-
"""Factory method to create the appropriate SystemDatabase implementation based on URL."""
|
1465
|
-
if system_database_url.startswith("sqlite"):
|
1466
|
-
from ._sys_db_sqlite import SQLiteSystemDatabase
|
1467
|
-
|
1468
|
-
return SQLiteSystemDatabase(
|
1469
|
-
system_database_url=system_database_url,
|
1470
|
-
engine_kwargs=engine_kwargs,
|
1471
|
-
engine=engine,
|
1472
|
-
schema=schema,
|
1473
|
-
debug_mode=debug_mode,
|
1474
|
-
)
|
1475
|
-
else:
|
1476
|
-
from ._sys_db_postgres import PostgresSystemDatabase
|
1477
|
-
|
1478
|
-
return PostgresSystemDatabase(
|
1479
|
-
system_database_url=system_database_url,
|
1480
|
-
engine_kwargs=engine_kwargs,
|
1481
|
-
engine=engine,
|
1482
|
-
schema=schema,
|
1483
|
-
debug_mode=debug_mode,
|
1484
|
-
)
|
1485
|
-
|
1486
1504
|
@db_retry()
|
1487
1505
|
def sleep(
|
1488
1506
|
self,
|
@@ -1502,7 +1520,7 @@ class SystemDatabase(ABC):
|
|
1502
1520
|
if recorded_output is not None:
|
1503
1521
|
dbos_logger.debug(f"Replaying sleep, id: {function_id}, seconds: {seconds}")
|
1504
1522
|
assert recorded_output["output"] is not None, "no recorded end time"
|
1505
|
-
end_time =
|
1523
|
+
end_time = self.serializer.deserialize(recorded_output["output"])
|
1506
1524
|
else:
|
1507
1525
|
dbos_logger.debug(f"Running sleep, id: {function_id}, seconds: {seconds}")
|
1508
1526
|
end_time = time.time() + seconds
|
@@ -1512,7 +1530,7 @@ class SystemDatabase(ABC):
|
|
1512
1530
|
"workflow_uuid": workflow_uuid,
|
1513
1531
|
"function_id": function_id,
|
1514
1532
|
"function_name": function_name,
|
1515
|
-
"output":
|
1533
|
+
"output": self.serializer.serialize(end_time),
|
1516
1534
|
"error": None,
|
1517
1535
|
}
|
1518
1536
|
)
|
@@ -1550,11 +1568,11 @@ class SystemDatabase(ABC):
|
|
1550
1568
|
.values(
|
1551
1569
|
workflow_uuid=workflow_uuid,
|
1552
1570
|
key=key,
|
1553
|
-
value=
|
1571
|
+
value=self.serializer.serialize(message),
|
1554
1572
|
)
|
1555
1573
|
.on_conflict_do_update(
|
1556
1574
|
index_elements=["workflow_uuid", "key"],
|
1557
|
-
set_={"value":
|
1575
|
+
set_={"value": self.serializer.serialize(message)},
|
1558
1576
|
)
|
1559
1577
|
)
|
1560
1578
|
output: OperationResultInternal = {
|
@@ -1578,11 +1596,11 @@ class SystemDatabase(ABC):
|
|
1578
1596
|
.values(
|
1579
1597
|
workflow_uuid=workflow_uuid,
|
1580
1598
|
key=key,
|
1581
|
-
value=
|
1599
|
+
value=self.serializer.serialize(message),
|
1582
1600
|
)
|
1583
1601
|
.on_conflict_do_update(
|
1584
1602
|
index_elements=["workflow_uuid", "key"],
|
1585
|
-
set_={"value":
|
1603
|
+
set_={"value": self.serializer.serialize(message)},
|
1586
1604
|
)
|
1587
1605
|
)
|
1588
1606
|
|
@@ -1607,7 +1625,7 @@ class SystemDatabase(ABC):
|
|
1607
1625
|
events: Dict[str, Any] = {}
|
1608
1626
|
for row in rows:
|
1609
1627
|
key = row[0]
|
1610
|
-
value =
|
1628
|
+
value = self.serializer.deserialize(row[1])
|
1611
1629
|
events[key] = value
|
1612
1630
|
|
1613
1631
|
return events
|
@@ -1641,7 +1659,7 @@ class SystemDatabase(ABC):
|
|
1641
1659
|
f"Replaying get_event, id: {caller_ctx['function_id']}, key: {key}"
|
1642
1660
|
)
|
1643
1661
|
if recorded_output["output"] is not None:
|
1644
|
-
return
|
1662
|
+
return self.serializer.deserialize(recorded_output["output"])
|
1645
1663
|
else:
|
1646
1664
|
raise Exception("No output recorded in the last get_event")
|
1647
1665
|
else:
|
@@ -1666,7 +1684,7 @@ class SystemDatabase(ABC):
|
|
1666
1684
|
|
1667
1685
|
value: Any = None
|
1668
1686
|
if len(init_recv) > 0:
|
1669
|
-
value =
|
1687
|
+
value = self.serializer.deserialize(init_recv[0][0])
|
1670
1688
|
else:
|
1671
1689
|
# Wait for the notification
|
1672
1690
|
actual_timeout = timeout_seconds
|
@@ -1684,7 +1702,7 @@ class SystemDatabase(ABC):
|
|
1684
1702
|
with self.engine.begin() as c:
|
1685
1703
|
final_recv = c.execute(get_sql).fetchall()
|
1686
1704
|
if len(final_recv) > 0:
|
1687
|
-
value =
|
1705
|
+
value = self.serializer.deserialize(final_recv[0][0])
|
1688
1706
|
condition.release()
|
1689
1707
|
self.workflow_events_map.pop(payload)
|
1690
1708
|
|
@@ -1695,7 +1713,7 @@ class SystemDatabase(ABC):
|
|
1695
1713
|
"workflow_uuid": caller_ctx["workflow_uuid"],
|
1696
1714
|
"function_id": caller_ctx["function_id"],
|
1697
1715
|
"function_name": function_name,
|
1698
|
-
"output":
|
1716
|
+
"output": self.serializer.serialize(
|
1699
1717
|
value
|
1700
1718
|
), # None will be serialized to 'null'
|
1701
1719
|
"error": None,
|
@@ -1703,8 +1721,41 @@ class SystemDatabase(ABC):
|
|
1703
1721
|
)
|
1704
1722
|
return value
|
1705
1723
|
|
1724
|
+
@db_retry()
|
1725
|
+
def get_queue_partitions(self, queue_name: str) -> List[str]:
|
1726
|
+
"""
|
1727
|
+
Get all unique partition names associated with a queue for ENQUEUED workflows.
|
1728
|
+
|
1729
|
+
Args:
|
1730
|
+
queue_name: The name of the queue to get partitions for
|
1731
|
+
|
1732
|
+
Returns:
|
1733
|
+
A list of unique partition names for the queue
|
1734
|
+
"""
|
1735
|
+
with self.engine.begin() as c:
|
1736
|
+
query = (
|
1737
|
+
sa.select(SystemSchema.workflow_status.c.queue_partition_key)
|
1738
|
+
.distinct()
|
1739
|
+
.where(SystemSchema.workflow_status.c.queue_name == queue_name)
|
1740
|
+
.where(
|
1741
|
+
SystemSchema.workflow_status.c.status.in_(
|
1742
|
+
[
|
1743
|
+
WorkflowStatusString.ENQUEUED.value,
|
1744
|
+
]
|
1745
|
+
)
|
1746
|
+
)
|
1747
|
+
.where(SystemSchema.workflow_status.c.queue_partition_key.isnot(None))
|
1748
|
+
)
|
1749
|
+
|
1750
|
+
rows = c.execute(query).fetchall()
|
1751
|
+
return [row[0] for row in rows]
|
1752
|
+
|
1706
1753
|
def start_queued_workflows(
|
1707
|
-
self,
|
1754
|
+
self,
|
1755
|
+
queue: "Queue",
|
1756
|
+
executor_id: str,
|
1757
|
+
app_version: str,
|
1758
|
+
queue_partition_key: Optional[str],
|
1708
1759
|
) -> List[str]:
|
1709
1760
|
if self._debug_mode:
|
1710
1761
|
return []
|
@@ -1723,6 +1774,10 @@ class SystemDatabase(ABC):
|
|
1723
1774
|
sa.select(sa.func.count())
|
1724
1775
|
.select_from(SystemSchema.workflow_status)
|
1725
1776
|
.where(SystemSchema.workflow_status.c.queue_name == queue.name)
|
1777
|
+
.where(
|
1778
|
+
SystemSchema.workflow_status.c.queue_partition_key
|
1779
|
+
== queue_partition_key
|
1780
|
+
)
|
1726
1781
|
.where(
|
1727
1782
|
SystemSchema.workflow_status.c.status
|
1728
1783
|
!= WorkflowStatusString.ENQUEUED.value
|
@@ -1747,6 +1802,10 @@ class SystemDatabase(ABC):
|
|
1747
1802
|
)
|
1748
1803
|
.select_from(SystemSchema.workflow_status)
|
1749
1804
|
.where(SystemSchema.workflow_status.c.queue_name == queue.name)
|
1805
|
+
.where(
|
1806
|
+
SystemSchema.workflow_status.c.queue_partition_key
|
1807
|
+
== queue_partition_key
|
1808
|
+
)
|
1750
1809
|
.where(
|
1751
1810
|
SystemSchema.workflow_status.c.status
|
1752
1811
|
== WorkflowStatusString.PENDING.value
|
@@ -1788,6 +1847,10 @@ class SystemDatabase(ABC):
|
|
1788
1847
|
)
|
1789
1848
|
.select_from(SystemSchema.workflow_status)
|
1790
1849
|
.where(SystemSchema.workflow_status.c.queue_name == queue.name)
|
1850
|
+
.where(
|
1851
|
+
SystemSchema.workflow_status.c.queue_partition_key
|
1852
|
+
== queue_partition_key
|
1853
|
+
)
|
1791
1854
|
.where(
|
1792
1855
|
SystemSchema.workflow_status.c.status
|
1793
1856
|
== WorkflowStatusString.ENQUEUED.value
|
@@ -1897,12 +1960,13 @@ class SystemDatabase(ABC):
|
|
1897
1960
|
)
|
1898
1961
|
if res is not None:
|
1899
1962
|
if res["output"] is not None:
|
1900
|
-
resstat: SystemDatabase.T =
|
1963
|
+
resstat: SystemDatabase.T = self.serializer.deserialize(
|
1901
1964
|
res["output"]
|
1902
1965
|
)
|
1903
1966
|
return resstat
|
1904
1967
|
elif res["error"] is not None:
|
1905
|
-
|
1968
|
+
e: Exception = self.serializer.deserialize(res["error"])
|
1969
|
+
raise e
|
1906
1970
|
else:
|
1907
1971
|
raise Exception(
|
1908
1972
|
f"Recorded output and error are both None for {function_name}"
|
@@ -1914,7 +1978,7 @@ class SystemDatabase(ABC):
|
|
1914
1978
|
"workflow_uuid": ctx.workflow_id,
|
1915
1979
|
"function_id": ctx.function_id,
|
1916
1980
|
"function_name": function_name,
|
1917
|
-
"output":
|
1981
|
+
"output": self.serializer.serialize(result),
|
1918
1982
|
"error": None,
|
1919
1983
|
}
|
1920
1984
|
)
|
@@ -1968,7 +2032,7 @@ class SystemDatabase(ABC):
|
|
1968
2032
|
)
|
1969
2033
|
|
1970
2034
|
# Serialize the value before storing
|
1971
|
-
serialized_value =
|
2035
|
+
serialized_value = self.serializer.serialize(value)
|
1972
2036
|
|
1973
2037
|
# Insert the new stream entry
|
1974
2038
|
c.execute(
|
@@ -2023,7 +2087,7 @@ class SystemDatabase(ABC):
|
|
2023
2087
|
)
|
2024
2088
|
|
2025
2089
|
# Serialize the value before storing
|
2026
|
-
serialized_value =
|
2090
|
+
serialized_value = self.serializer.serialize(value)
|
2027
2091
|
|
2028
2092
|
# Insert the new stream entry
|
2029
2093
|
c.execute(
|
@@ -2068,7 +2132,7 @@ class SystemDatabase(ABC):
|
|
2068
2132
|
)
|
2069
2133
|
|
2070
2134
|
# Deserialize the value before returning
|
2071
|
-
return
|
2135
|
+
return self.serializer.deserialize(result[0])
|
2072
2136
|
|
2073
2137
|
def garbage_collect(
|
2074
2138
|
self, cutoff_epoch_timestamp_ms: Optional[int], rows_threshold: Optional[int]
|
dbos/cli/migration.py
CHANGED
@@ -4,6 +4,7 @@ import sqlalchemy as sa
|
|
4
4
|
import typer
|
5
5
|
|
6
6
|
from dbos._app_db import ApplicationDatabase
|
7
|
+
from dbos._serialization import DefaultSerializer
|
7
8
|
from dbos._sys_db import SystemDatabase
|
8
9
|
|
9
10
|
|
@@ -22,6 +23,7 @@ def migrate_dbos_databases(
|
|
22
23
|
},
|
23
24
|
engine=None,
|
24
25
|
schema=schema,
|
26
|
+
serializer=DefaultSerializer(),
|
25
27
|
)
|
26
28
|
sys_db.run_migrations()
|
27
29
|
if app_database_url:
|
@@ -33,6 +35,7 @@ def migrate_dbos_databases(
|
|
33
35
|
"pool_size": 2,
|
34
36
|
},
|
35
37
|
schema=schema,
|
38
|
+
serializer=DefaultSerializer(),
|
36
39
|
)
|
37
40
|
app_db.run_migrations()
|
38
41
|
except Exception as e:
|
@@ -1,20 +1,20 @@
|
|
1
|
-
dbos-2.
|
2
|
-
dbos-2.
|
3
|
-
dbos-2.
|
4
|
-
dbos-2.
|
5
|
-
dbos/__init__.py,sha256=
|
1
|
+
dbos-2.2.0.dist-info/METADATA,sha256=CRM_iSw04HkfgSVZQzOeyl3L2YCOk73b0is60R1n8bM,14530
|
2
|
+
dbos-2.2.0.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
3
|
+
dbos-2.2.0.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
4
|
+
dbos-2.2.0.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
5
|
+
dbos/__init__.py,sha256=M7FdFSBGhcvaLIXrNw_0eR68ijwMWV7_UEyimHMP_F4,1039
|
6
6
|
dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
|
7
7
|
dbos/_admin_server.py,sha256=hubQJw5T8zGKCPNS6FQTXy8jQ8GTJxoYQaDTMlICl9k,16267
|
8
|
-
dbos/_app_db.py,sha256=
|
8
|
+
dbos/_app_db.py,sha256=mvWQ66ebdbiD9fpGKHZBWNVEza6Ulo1D-3UoTB_LwRc,16378
|
9
9
|
dbos/_classproperty.py,sha256=f0X-_BySzn3yFDRKB2JpCbLYQ9tLwt1XftfshvY7CBs,626
|
10
|
-
dbos/_client.py,sha256=
|
10
|
+
dbos/_client.py,sha256=oUpIYcUsWHSH_w1fXQ4ZvbtmgnWZNgDmMj7UqUC0iRA,19317
|
11
11
|
dbos/_conductor/conductor.py,sha256=3E_hL3c9g9yWqKZkvI6KA0-ZzPMPRo06TOzT1esMiek,24114
|
12
12
|
dbos/_conductor/protocol.py,sha256=q3rgLxINFtWFigdOONc-4gX4vn66UmMlJQD6Kj8LnL4,7420
|
13
|
-
dbos/_context.py,sha256=
|
14
|
-
dbos/_core.py,sha256=
|
13
|
+
dbos/_context.py,sha256=XKllmsDR_oMcWOuZnoe1X4yv2JeOi_vsAuyWC-mWs_o,28164
|
14
|
+
dbos/_core.py,sha256=6OU3SMW5x8CvO7c0LBlHhF1eLiHPLs6nfkkasP73IEo,51124
|
15
15
|
dbos/_croniter.py,sha256=XHAyUyibs_59sJQfSNWkP7rqQY6_XrlfuuCxk4jYqek,47559
|
16
|
-
dbos/_dbos.py,sha256=
|
17
|
-
dbos/_dbos_config.py,sha256=
|
16
|
+
dbos/_dbos.py,sha256=dr32Z_NT36JkUxWGyYVX7xkl3bYJmgsxVMOX8H9_mpM,59394
|
17
|
+
dbos/_dbos_config.py,sha256=NIMQfxkznoyscyeMFLrfrPAS1W_PHXXWrxqpvvrbp3E,24923
|
18
18
|
dbos/_debouncer.py,sha256=qNjIVmWqTPp64M2cEbLnpgGmlKVdCaAKysD1BPJgWh4,15297
|
19
19
|
dbos/_debug.py,sha256=0MfgNqutCUhI4PEmmra9x7f3DiFE_0nscfUCHdLimEY,1415
|
20
20
|
dbos/_docker_pg_helper.py,sha256=xySum4hTA8TVMBODoG19u4cXQAB1vCock-jwM2pnmSI,7791
|
@@ -25,18 +25,18 @@ dbos/_flask.py,sha256=Npnakt-a3W5OykONFRkDRnumaDhTQmA0NPdUCGRYKXE,1652
|
|
25
25
|
dbos/_kafka.py,sha256=Gm4fHWl7gYb-i5BMvwNwm5Km3z8zQpseqdMgqgFjlGI,4252
|
26
26
|
dbos/_kafka_message.py,sha256=NYvOXNG3Qn7bghn1pv3fg4Pbs86ILZGcK4IB-MLUNu0,409
|
27
27
|
dbos/_logger.py,sha256=djnCp147QoQ1iG9Bt3Uz8RyGaXGmi6gebccXsrA6Cps,4660
|
28
|
-
dbos/_migration.py,sha256=
|
28
|
+
dbos/_migration.py,sha256=Fvc3m4dC4oDpjPMHX-tUZVnXklVB9OMMojSLuVyV9ak,10312
|
29
29
|
dbos/_outcome.py,sha256=7HvosMfEHTh1U5P6xok7kFTGLwa2lPaul0YApb3UnN4,8191
|
30
|
-
dbos/_queue.py,sha256=
|
30
|
+
dbos/_queue.py,sha256=GmqZHl9smES1KSmpauhSdsnZFJHDyfvRArmC-jBibhw,6228
|
31
31
|
dbos/_recovery.py,sha256=K-wlFhdf4yGRm6cUzyhcTjQUS0xp2T5rdNMLiiBErYg,2882
|
32
32
|
dbos/_registrations.py,sha256=bEOntObnWaBylnebr5ZpcX2hk7OVLDd1z4BvW4_y3zA,7380
|
33
33
|
dbos/_roles.py,sha256=kCuhhg8XLtrHCgKgm44I0abIRTGHltf88OwjEKAUggk,2317
|
34
|
-
dbos/_scheduler.py,sha256=
|
34
|
+
dbos/_scheduler.py,sha256=n96dNzKMr6-2RQvMxRI6BaoExHbLjw0Kr46j1P-DjP4,2620
|
35
35
|
dbos/_schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
36
|
dbos/_schemas/application_database.py,sha256=SypAS9l9EsaBHFn9FR8jmnqt01M74d9AF1AMa4m2hhI,1040
|
37
|
-
dbos/_schemas/system_database.py,sha256=
|
38
|
-
dbos/_serialization.py,sha256=
|
39
|
-
dbos/_sys_db.py,sha256=
|
37
|
+
dbos/_schemas/system_database.py,sha256=mNsBV0ttlqJArvOqGPY60WvtuiWrHCpYnVxtvMfe2LI,5544
|
38
|
+
dbos/_serialization.py,sha256=8TVXB1c2k3keodNcXszqmcOGTQz2r5UBSYtxn2OrYjI,2804
|
39
|
+
dbos/_sys_db.py,sha256=FDboSk58CyQCAFjOF_KMLnRtIw05OL3IpJHT1qwKEKo,87596
|
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
|
@@ -52,8 +52,8 @@ dbos/_workflow_commands.py,sha256=k-i1bCfNrux43BHLT8wQ-l-MVZX3D6LGZLH7-uuiDRo,49
|
|
52
52
|
dbos/cli/_github_init.py,sha256=R_94Fnn40CAmPy-zM00lwHi0ndyfv57TmIooADjmag4,3378
|
53
53
|
dbos/cli/_template_init.py,sha256=AltKk256VocgvxLpuTxpjJyACrdHFjbGoqYhHzeLae4,2649
|
54
54
|
dbos/cli/cli.py,sha256=s-gGQvHvVPeQp68raQElGnbBlSCv69JZ3HNFj5Qt2bs,27686
|
55
|
-
dbos/cli/migration.py,sha256=
|
55
|
+
dbos/cli/migration.py,sha256=I0_0ngWTuCPQf6Symbpd0lizaxWUKe3uTYEmuCmsrdU,3775
|
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-2.
|
59
|
+
dbos-2.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|