dbos 1.15.0a3__py3-none-any.whl → 1.15.0a4__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.

Potentially problematic release.


This version of dbos might be problematic. Click here for more details.

dbos/_admin_server.py CHANGED
@@ -244,7 +244,7 @@ class AdminRequestHandler(BaseHTTPRequestHandler):
244
244
  def _handle_restart(self, workflow_id: str) -> None:
245
245
  try:
246
246
  print(f"Restarting workflow {workflow_id}")
247
- handle = self.dbos.restart_workflow(workflow_id)
247
+ handle = self.dbos.fork_workflow(workflow_id, 1)
248
248
  response_body = json.dumps(
249
249
  {
250
250
  "workflow_id": handle.workflow_id,
dbos/_client.py CHANGED
@@ -124,7 +124,6 @@ class DBOSClient:
124
124
  system_database_url: Optional[str] = None,
125
125
  application_database_url: Optional[str] = None,
126
126
  dbos_system_schema: Optional[str] = "dbos",
127
- system_database: Optional[str] = None, # DEPRECATED
128
127
  ):
129
128
  application_database_url = (
130
129
  database_url if database_url else application_database_url
@@ -133,7 +132,6 @@ class DBOSClient:
133
132
  {
134
133
  "system_database_url": system_database_url,
135
134
  "database_url": application_database_url,
136
- "database": {"sys_db_name": system_database},
137
135
  }
138
136
  )
139
137
  assert is_valid_database_url(system_database_url)
dbos/_dbos.py CHANGED
@@ -1029,16 +1029,6 @@ class DBOS:
1029
1029
  await asyncio.to_thread(cls.resume_workflow, workflow_id)
1030
1030
  return await cls.retrieve_workflow_async(workflow_id)
1031
1031
 
1032
- @classmethod
1033
- def restart_workflow(cls, workflow_id: str) -> WorkflowHandle[Any]:
1034
- """Restart a workflow with a new workflow ID"""
1035
- return cls.fork_workflow(workflow_id, 1)
1036
-
1037
- @classmethod
1038
- async def restart_workflow_async(cls, workflow_id: str) -> WorkflowHandleAsync[Any]:
1039
- """Restart a workflow with a new workflow ID"""
1040
- return await cls.fork_workflow_async(workflow_id, 1)
1041
-
1042
1032
  @classmethod
1043
1033
  def fork_workflow(
1044
1034
  cls,
@@ -1274,20 +1264,6 @@ class DBOS:
1274
1264
  else:
1275
1265
  return None
1276
1266
 
1277
- @classproperty
1278
- def parent_workflow_id(cls) -> str:
1279
- """
1280
- This method is deprecated and should not be used.
1281
- """
1282
- dbos_logger.warning(
1283
- "DBOS.parent_workflow_id is deprecated and should not be used"
1284
- )
1285
- ctx = assert_current_dbos_context()
1286
- assert (
1287
- ctx.is_within_workflow()
1288
- ), "parent_workflow_id is only available within a workflow."
1289
- return ctx.parent_workflow_id
1290
-
1291
1267
  @classproperty
1292
1268
  def span(cls) -> "Span":
1293
1269
  """Return the tracing `Span` associated with the current context."""
dbos/_dbos_config.py CHANGED
@@ -22,7 +22,6 @@ class DBOSConfig(TypedDict, total=False):
22
22
  system_database_url (str): Connection string for the DBOS system database. Defaults to sqlite:///{name} if not provided.
23
23
  application_database_url (str): Connection string for the DBOS application database, in which DBOS @Transaction functions run. Optional. Should be the same type of database (SQLite or Postgres) as the system database.
24
24
  database_url (str): (DEPRECATED) Database connection string
25
- sys_db_name (str): (DEPRECATED) System database name
26
25
  sys_db_pool_size (int): System database pool size
27
26
  db_engine_kwargs (Dict[str, Any]): SQLAlchemy engine kwargs (See https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine)
28
27
  log_level (str): Log level
@@ -41,7 +40,6 @@ class DBOSConfig(TypedDict, total=False):
41
40
  system_database_url: Optional[str]
42
41
  application_database_url: Optional[str]
43
42
  database_url: Optional[str]
44
- sys_db_name: Optional[str]
45
43
  sys_db_pool_size: Optional[int]
46
44
  db_engine_kwargs: Optional[Dict[str, Any]]
47
45
  log_level: Optional[str]
@@ -74,14 +72,10 @@ class DatabaseConfig(TypedDict, total=False):
74
72
  dbos_system_schema (str): Schema name for DBOS system tables. Defaults to "dbos".
75
73
  """
76
74
 
77
- sys_db_name: Optional[str]
78
- sys_db_pool_size: Optional[
79
- int
80
- ] # For internal use, will be removed in a future version
75
+ sys_db_pool_size: Optional[int]
81
76
  db_engine_kwargs: Optional[Dict[str, Any]]
82
77
  sys_db_engine_kwargs: Optional[Dict[str, Any]]
83
78
  migrate: Optional[List[str]]
84
- rollback: Optional[List[str]] # Will be removed in a future version
85
79
 
86
80
 
87
81
  class OTLPExporterConfig(TypedDict, total=False):
@@ -139,8 +133,6 @@ def translate_dbos_config_to_config_file(config: DBOSConfig) -> ConfigFile:
139
133
 
140
134
  # Database config
141
135
  db_config: DatabaseConfig = {}
142
- if "sys_db_name" in config:
143
- db_config["sys_db_name"] = config.get("sys_db_name")
144
136
  if "sys_db_pool_size" in config:
145
137
  db_config["sys_db_pool_size"] = config.get("sys_db_pool_size")
146
138
  if "db_engine_kwargs" in config:
@@ -409,10 +401,7 @@ def process_config(
409
401
  else:
410
402
  url = make_url(data["database_url"])
411
403
  assert url.database
412
- if data["database"].get("sys_db_name"):
413
- url = url.set(database=data["database"]["sys_db_name"])
414
- else:
415
- url = url.set(database=f"{url.database}{SystemSchema.sysdb_suffix}")
404
+ url = url.set(database=f"{url.database}{SystemSchema.sysdb_suffix}")
416
405
  data["system_database_url"] = url.render_as_string(hide_password=False)
417
406
 
418
407
  # If a system database URL is provided but not an application database URL,
@@ -617,11 +606,8 @@ def get_system_database_url(config: ConfigFile) -> str:
617
606
  if config["database_url"].startswith("sqlite"):
618
607
  return config["database_url"]
619
608
  app_db_url = make_url(config["database_url"])
620
- if config.get("database") and config["database"].get("sys_db_name") is not None:
621
- sys_db_name = config["database"]["sys_db_name"]
622
- else:
623
- assert app_db_url.database is not None
624
- sys_db_name = app_db_url.database + SystemSchema.sysdb_suffix
609
+ assert app_db_url.database is not None
610
+ sys_db_name = app_db_url.database + SystemSchema.sysdb_suffix
625
611
  return app_db_url.set(database=sys_db_name).render_as_string(
626
612
  hide_password=False
627
613
  )
dbos/cli/cli.py CHANGED
@@ -681,48 +681,6 @@ def resume(
681
681
  client.resume_workflow(workflow_id=workflow_id)
682
682
 
683
683
 
684
- @workflow.command(
685
- help="[DEPRECATED - Use fork instead] Restart a workflow from the beginning with a new id"
686
- )
687
- def restart(
688
- workflow_id: Annotated[str, typer.Argument()],
689
- application_database_url: Annotated[
690
- typing.Optional[str],
691
- typer.Option(
692
- "--db-url",
693
- "-D",
694
- help="Your DBOS application database URL",
695
- ),
696
- ] = None,
697
- system_database_url: Annotated[
698
- typing.Optional[str],
699
- typer.Option(
700
- "--sys-db-url",
701
- "-s",
702
- help="Your DBOS system database URL",
703
- ),
704
- ] = None,
705
- schema: Annotated[
706
- typing.Optional[str],
707
- typer.Option(
708
- "--schema",
709
- help='Schema name for DBOS system tables. Defaults to "dbos".',
710
- ),
711
- ] = "dbos",
712
- ) -> None:
713
- system_database_url, application_database_url = _get_db_url(
714
- system_database_url=system_database_url,
715
- application_database_url=application_database_url,
716
- )
717
- client = DBOSClient(
718
- application_database_url=application_database_url,
719
- system_database_url=system_database_url,
720
- dbos_system_schema=schema,
721
- )
722
- status = client.fork_workflow(workflow_id=workflow_id, start_step=1).get_status()
723
- print(json.dumps(status.__dict__, cls=DefaultEncoder))
724
-
725
-
726
684
  @workflow.command(
727
685
  help="fork a workflow from the beginning with a new id and from a step"
728
686
  )
@@ -27,99 +27,14 @@
27
27
  "type": "object",
28
28
  "additionalProperties": false,
29
29
  "properties": {
30
- "hostname": {
31
- "type": ["string", "null"],
32
- "description": "The hostname or IP address of the application database. DEPRECATED: Use database_url instead",
33
- "deprecated": true
34
- },
35
- "port": {
36
- "type": ["number", "null"],
37
- "description": "The port number of the application database. DEPRECATED: Use database_url instead",
38
- "deprecated": true
39
- },
40
- "username": {
41
- "type": ["string", "null"],
42
- "description": "The username to use when connecting to the application database. DEPRECATED: Use database_url instead",
43
- "not": {
44
- "enum": ["dbos"]
45
- },
46
- "deprecated": true
47
- },
48
- "password": {
49
- "type": ["string", "null"],
50
- "description": "The password to use when connecting to the application database. Developers are strongly encouraged to use environment variable substitution (${VAR_NAME}) or Docker secrets (${DOCKER_SECRET:SECRET_NAME}) to avoid storing secrets in source. DEPRECATED: Use database_url instead",
51
- "deprecated": true
52
- },
53
- "connectionTimeoutMillis": {
54
- "type": ["number", "null"],
55
- "description": "The number of milliseconds the system waits before timing out when connecting to the application database. DEPRECATED: Use database_url instead",
56
- "deprecated": true
57
- },
58
30
  "app_db_name": {
59
31
  "type": ["string", "null"],
60
- "description": "The name of the application database. DEPRECATED: Use database_url instead",
61
- "deprecated": true
62
- },
63
- "sys_db_name": {
64
- "type": "string",
65
- "description": "The name of the system database"
66
- },
67
- "ssl": {
68
- "type": ["boolean", "null"],
69
- "description": "Use SSL/TLS to securely connect to the database (default: true). DEPRECATED: Use database_url instead",
70
- "deprecated": true
71
- },
72
- "ssl_ca": {
73
- "type": ["string", "null"],
74
- "description": "If using SSL/TLS to securely connect to a database, path to an SSL root certificate file. DEPRECATED: Use database_url instead",
32
+ "description": "The name of the application database in DBOS Cloud",
75
33
  "deprecated": true
76
34
  },
77
35
  "migrate": {
78
36
  "type": "array",
79
- "description": "Specify a list of user DB migration commands to run"
80
- },
81
- "rollback": {
82
- "type": "array",
83
- "description": "Specify a list of user DB rollback commands to run. DEPRECATED",
84
- "deprecated": true
85
- }
86
- }
87
- },
88
- "telemetry": {
89
- "type": "object",
90
- "additionalProperties": false,
91
- "properties": {
92
- "logs": {
93
- "type": "object",
94
- "additionalProperties": false,
95
- "properties": {
96
- "addContextMetadata": {
97
- "type": "boolean",
98
- "description": "Adds contextual information, such as workflow UUID, to each log entry"
99
- },
100
- "logLevel": {
101
- "type": "string",
102
- "description": "A filter on what logs should be printed to the standard output"
103
- },
104
- "silent": {
105
- "type": "boolean",
106
- "description": "Silences the logger such that nothing is printed to the standard output"
107
- }
108
- }
109
- },
110
- "OTLPExporter": {
111
- "type": "object",
112
- "additionalProperties": false,
113
- "properties": {
114
- "logsEndpoint": {
115
- "type": "string",
116
- "description": "The URL of an OTLP collector to which to export logs"
117
- },
118
- "tracesEndpoint": {
119
- "type": "string",
120
- "description": "The URL of an OTLP collector to which to export traces"
121
- }
122
- }
37
+ "description": "Specify a list of user database migration commands to run in DBOS Cloud"
123
38
  }
124
39
  }
125
40
  },
@@ -127,56 +42,20 @@
127
42
  "type": "object",
128
43
  "additionalProperties": false,
129
44
  "properties": {
130
- "entrypoints": {
131
- "type": "array",
132
- "items": {
133
- "type": "string"
134
- }
135
- },
136
- "port": {
137
- "type": "number"
138
- },
139
45
  "start": {
140
46
  "type": "array",
141
- "description": "Specify commands to run to start your application (Python only)"
47
+ "description": "Specify commands to run to start your application in DBOS Cloud"
142
48
  },
143
49
  "setup": {
144
50
  "type": "array",
145
51
  "items": {
146
52
  "type": "string"
147
53
  },
148
- "description": "Commands to setup the application execution environment"
149
- },
150
- "admin_port": {
151
- "type": "number",
152
- "description": "The port number of the admin server (Default: 3001)"
54
+ "description": "Commands to setup the application execution environment in DBOS Cloud"
153
55
  }
154
56
  }
155
57
  },
156
- "http": {
157
- "type": "object",
158
- "additionalProperties": false,
159
- "properties": {
160
- "cors_middleware": {
161
- "type": "boolean"
162
- },
163
- "credentials": {
164
- "type": "boolean"
165
- },
166
- "allowed_origins": {
167
- "type": "array",
168
- "items": {
169
- "type": "string"
170
- }
171
- }
172
- }
173
- },
174
- "application": {},
175
- "env": {},
176
- "version": {
177
- "type": "string",
178
- "deprecated": true
179
- }
58
+ "env": {}
180
59
  }
181
60
  }
182
61
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 1.15.0a3
3
+ Version: 1.15.0a4
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1,20 +1,20 @@
1
- dbos-1.15.0a3.dist-info/METADATA,sha256=Ft-tggTIl0dxVo3Byd4BKytIRVdvegchZIKPnrcnq0w,13021
2
- dbos-1.15.0a3.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
- dbos-1.15.0a3.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
- dbos-1.15.0a3.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
1
+ dbos-1.15.0a4.dist-info/METADATA,sha256=Oh-h2s9-N7b65sHnbYdU8NZDMLf2kUrJ3r5AsJHRfCQ,13021
2
+ dbos-1.15.0a4.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ dbos-1.15.0a4.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
+ dbos-1.15.0a4.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
- dbos/_admin_server.py,sha256=e8ELhcDWqR3_PNobnNgUvLGh5lzZq0yFSF6dvtzoQRI,16267
7
+ dbos/_admin_server.py,sha256=hubQJw5T8zGKCPNS6FQTXy8jQ8GTJxoYQaDTMlICl9k,16267
8
8
  dbos/_app_db.py,sha256=WJwUdKsTpSZPCIWVeSF5FQNf5y1PF_lJ96tiaCjvck8,16385
9
9
  dbos/_classproperty.py,sha256=f0X-_BySzn3yFDRKB2JpCbLYQ9tLwt1XftfshvY7CBs,626
10
- dbos/_client.py,sha256=Rp1OiT5523QosHB8Qy0xe9eWNx9osZGhfQknO122hj8,18928
10
+ dbos/_client.py,sha256=1M2PhMNodw7Cnfrs3D0_NbwY0VnDoA1OnAOkBnLzTGg,18805
11
11
  dbos/_conductor/conductor.py,sha256=3E_hL3c9g9yWqKZkvI6KA0-ZzPMPRo06TOzT1esMiek,24114
12
12
  dbos/_conductor/protocol.py,sha256=q3rgLxINFtWFigdOONc-4gX4vn66UmMlJQD6Kj8LnL4,7420
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=ReujpyRseUNL_9FQN-uIhSFh6HJnAA2IAcVy6qDdEco,58036
17
- dbos/_dbos_config.py,sha256=pnFeWZFDsk_94DWDCqm3e-ppTrqBFKQQdD5TvQGZ8-Y,25963
16
+ dbos/_dbos.py,sha256=gYAtagCiSX45HtG2oZQA75V-jzpcvv0u7_V8Jv0STWg,57156
17
+ dbos/_dbos_config.py,sha256=ha0Qo4kRCCi1dQZZzm1e24iMqR2Zty9LejcLxUbzlUg,25286
18
18
  dbos/_debouncer.py,sha256=VmGq1_ZIQ79fnH14LEhdoqxKWp6rlEwzsUwumwAMgTQ,15095
19
19
  dbos/_debug.py,sha256=0MfgNqutCUhI4PEmmra9x7f3DiFE_0nscfUCHdLimEY,1415
20
20
  dbos/_docker_pg_helper.py,sha256=xySum4hTA8TVMBODoG19u4cXQAB1vCock-jwM2pnmSI,7791
@@ -51,9 +51,9 @@ dbos/_utils.py,sha256=ZdoM1MDbHnlJrh31zfhp3iX62bAxK1kyvMwXnltC_84,1779
51
51
  dbos/_workflow_commands.py,sha256=k-i1bCfNrux43BHLT8wQ-l-MVZX3D6LGZLH7-uuiDRo,4951
52
52
  dbos/cli/_github_init.py,sha256=R_94Fnn40CAmPy-zM00lwHi0ndyfv57TmIooADjmag4,3378
53
53
  dbos/cli/_template_init.py,sha256=AltKk256VocgvxLpuTxpjJyACrdHFjbGoqYhHzeLae4,2649
54
- dbos/cli/cli.py,sha256=K8Fz05qach61EMuv5reUMRgT-UltysGZ4XerOTR4KEg,29003
54
+ dbos/cli/cli.py,sha256=s-gGQvHvVPeQp68raQElGnbBlSCv69JZ3HNFj5Qt2bs,27686
55
55
  dbos/cli/migration.py,sha256=1Y52EMc2rX7PJgJa3_KXV7oiQEO569k7aHXRofwYipo,3608
56
- dbos/dbos-config.schema.json,sha256=LyUT1DOTaAwOP6suxQGS5KemVIqXGPyu_q7Hbo0neA8,6192
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-1.15.0a3.dist-info/RECORD,,
59
+ dbos-1.15.0a4.dist-info/RECORD,,