dbos 0.15.0__py3-none-any.whl → 0.16.0a1__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/_context.py CHANGED
@@ -98,18 +98,27 @@ class DBOSContext:
98
98
  wfid = str(uuid.uuid4())
99
99
  return wfid
100
100
 
101
- def start_workflow(self, wfid: Optional[str], attributes: TracedAttributes) -> None:
101
+ def start_workflow(
102
+ self,
103
+ wfid: Optional[str],
104
+ attributes: TracedAttributes,
105
+ is_temp_workflow: bool = False,
106
+ ) -> None:
102
107
  if wfid is None or len(wfid) == 0:
103
108
  wfid = self.assign_workflow_id()
104
109
  self.id_assigned_for_next_workflow = ""
105
110
  self.workflow_id = wfid
106
111
  self.function_id = 0
107
- self._start_span(attributes)
112
+ if not is_temp_workflow:
113
+ self._start_span(attributes)
108
114
 
109
- def end_workflow(self, exc_value: Optional[BaseException]) -> None:
115
+ def end_workflow(
116
+ self, exc_value: Optional[BaseException], is_temp_workflow: bool = False
117
+ ) -> None:
110
118
  self.workflow_id = ""
111
119
  self.function_id = -1
112
- self._end_span(exc_value)
120
+ if not is_temp_workflow:
121
+ self._end_span(exc_value)
113
122
 
114
123
  def is_within_workflow(self) -> bool:
115
124
  return len(self.workflow_id) > 0
@@ -349,6 +358,7 @@ class EnterDBOSWorkflow(AbstractContextManager[DBOSContext, Literal[False]]):
349
358
  def __init__(self, attributes: TracedAttributes) -> None:
350
359
  self.created_ctx = False
351
360
  self.attributes = attributes
361
+ self.is_temp_workflow = attributes["name"] == "temp_wf"
352
362
 
353
363
  def __enter__(self) -> DBOSContext:
354
364
  # Code to create a basic context
@@ -359,7 +369,7 @@ class EnterDBOSWorkflow(AbstractContextManager[DBOSContext, Literal[False]]):
359
369
  _set_local_dbos_context(ctx)
360
370
  assert not ctx.is_within_workflow()
361
371
  ctx.start_workflow(
362
- None, self.attributes
372
+ None, self.attributes, self.is_temp_workflow
363
373
  ) # Will get from the context's next workflow ID
364
374
  return ctx
365
375
 
@@ -371,7 +381,7 @@ class EnterDBOSWorkflow(AbstractContextManager[DBOSContext, Literal[False]]):
371
381
  ) -> Literal[False]:
372
382
  ctx = assert_current_dbos_context()
373
383
  assert ctx.is_within_workflow()
374
- ctx.end_workflow(exc_value)
384
+ ctx.end_workflow(exc_value, self.is_temp_workflow)
375
385
  # Code to clean up the basic context if we created it
376
386
  if self.created_ctx:
377
387
  _clear_local_dbos_context()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 0.15.0
3
+ Version: 0.16.0a1
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
- dbos-0.15.0.dist-info/METADATA,sha256=-aMAE-dEtjH923_XUsCYXTgKh5NO9M2IBJYvyX5zNNc,5020
2
- dbos-0.15.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- dbos-0.15.0.dist-info/entry_points.txt,sha256=z6GcVANQV7Uw_82H9Ob2axJX6V3imftyZsljdh-M1HU,54
4
- dbos-0.15.0.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
1
+ dbos-0.16.0a1.dist-info/METADATA,sha256=Ot-t51IX5WxqKU-LyjhEyflD7lJaLr5iq7LRCK8O_TI,5022
2
+ dbos-0.16.0a1.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ dbos-0.16.0a1.dist-info/entry_points.txt,sha256=z6GcVANQV7Uw_82H9Ob2axJX6V3imftyZsljdh-M1HU,54
4
+ dbos-0.16.0a1.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
5
5
  dbos/__init__.py,sha256=CxRHBHEthPL4PZoLbZhp3rdm44-KkRTT2-7DkK9d4QQ,724
6
6
  dbos/_admin_server.py,sha256=DOgzVp9kmwiebQqmJB1LcrZnGTxSMbZiGXdenc1wZDg,3163
7
7
  dbos/_app_db.py,sha256=_tv2vmPjjiaikwgxH3mqxgJ4nUUcG2-0uMXKWCqVu1c,5509
8
8
  dbos/_classproperty.py,sha256=f0X-_BySzn3yFDRKB2JpCbLYQ9tLwt1XftfshvY7CBs,626
9
- dbos/_context.py,sha256=SJZTOB-saxCNNGT2LLop9LasqR-X2MQLTay3rjXRUCw,17748
9
+ dbos/_context.py,sha256=KV3fd3-Rv6EWrYDUdHARxltSlNZGNtQtNSqeQ-gkXE8,18049
10
10
  dbos/_core.py,sha256=HUteo2HP9C4UvB-y41xwUphLZyYRTdb0sW5XqZ6QPAY,31167
11
11
  dbos/_croniter.py,sha256=hbhgfsHBqclUS8VeLnJ9PSE9Z54z6mi4nnrr1aUXn0k,47561
12
12
  dbos/_dbos.py,sha256=iYI-iY3kp_N0lNYYVKwssea7dgD7vsYHn2uBIhmZ2lM,31478
@@ -51,4 +51,4 @@ dbos/cli.py,sha256=em1uAxrp5yyg53V7ZpmHFtqD6OJp2cMJkG9vGJPoFTA,10904
51
51
  dbos/dbos-config.schema.json,sha256=tS7x-bdFbFvpobcs3pIOhwun3yr_ndvTEYOn4BJjTzs,5889
52
52
  dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
53
53
  version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
54
- dbos-0.15.0.dist-info/RECORD,,
54
+ dbos-0.16.0a1.dist-info/RECORD,,
File without changes