durabletask 0.2.1__py3-none-any.whl → 0.4.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.

Potentially problematic release.


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

durabletask/task.py CHANGED
@@ -35,6 +35,21 @@ class OrchestrationContext(ABC):
35
35
  """
36
36
  pass
37
37
 
38
+ @property
39
+ @abstractmethod
40
+ def version(self) -> Optional[str]:
41
+ """Get the version of the orchestration instance.
42
+
43
+ This version is set when the orchestration is scheduled and can be used
44
+ to determine which version of the orchestrator function is being executed.
45
+
46
+ Returns
47
+ -------
48
+ Optional[str]
49
+ The version of the orchestration instance, or None if not set.
50
+ """
51
+ pass
52
+
38
53
  @property
39
54
  @abstractmethod
40
55
  def current_utc_datetime(self) -> datetime:
@@ -100,7 +115,8 @@ class OrchestrationContext(ABC):
100
115
  @abstractmethod
101
116
  def call_activity(self, activity: Union[Activity[TInput, TOutput], str], *,
102
117
  input: Optional[TInput] = None,
103
- retry_policy: Optional[RetryPolicy] = None) -> Task[TOutput]:
118
+ retry_policy: Optional[RetryPolicy] = None,
119
+ tags: Optional[dict[str, str]] = None) -> Task[TOutput]:
104
120
  """Schedule an activity for execution.
105
121
 
106
122
  Parameters
@@ -111,6 +127,8 @@ class OrchestrationContext(ABC):
111
127
  The JSON-serializable input (or None) to pass to the activity.
112
128
  retry_policy: Optional[RetryPolicy]
113
129
  The retry policy to use for this activity call.
130
+ tags: Optional[dict[str, str]]
131
+ Optional tags to associate with the activity invocation.
114
132
 
115
133
  Returns
116
134
  -------
@@ -123,7 +141,8 @@ class OrchestrationContext(ABC):
123
141
  def call_sub_orchestrator(self, orchestrator: Orchestrator[TInput, TOutput], *,
124
142
  input: Optional[TInput] = None,
125
143
  instance_id: Optional[str] = None,
126
- retry_policy: Optional[RetryPolicy] = None) -> Task[TOutput]:
144
+ retry_policy: Optional[RetryPolicy] = None,
145
+ version: Optional[str] = None) -> Task[TOutput]:
127
146
  """Schedule sub-orchestrator function for execution.
128
147
 
129
148
  Parameters