Skip to content

Commit 86ee081

Browse files
authored
Merge branch 'main' into andystaples/add-functions-support
2 parents af0e3c2 + 901c63d commit 86ee081

File tree

15 files changed

+317
-69
lines changed

15 files changed

+317
-69
lines changed

.github/workflows/durabletask-azuremanaged.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Set up Python 3.13
18+
- name: Set up Python 3.14
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: 3.13
21+
python-version: 3.14
2222
- name: Install dependencies
2323
working-directory: durabletask-azuremanaged
2424
run: |
@@ -36,7 +36,7 @@ jobs:
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
39+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4040
env:
4141
EMULATOR_VERSION: "latest"
4242
needs: lint
@@ -100,7 +100,7 @@ jobs:
100100
- name: Set up Python
101101
uses: actions/setup-python@v5
102102
with:
103-
python-version: "3.13" # Adjust Python version as needed
103+
python-version: "3.14" # Adjust Python version as needed
104104

105105
- name: Install dependencies
106106
run: |

.github/workflows/durabletask.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Set up Python 3.13
18+
- name: Set up Python 3.14
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: 3.13
21+
python-version: 3.14
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
@@ -38,7 +38,7 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
41+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4242
needs: lint-and-unit-tests
4343
runs-on: ubuntu-latest
4444
steps:
@@ -85,7 +85,7 @@ jobs:
8585
- name: Set up Python
8686
uses: actions/setup-python@v5
8787
with:
88-
python-version: "3.13" # Adjust Python version as needed
88+
python-version: "3.14" # Adjust Python version as needed
8989

9090
- name: Install dependencies
9191
run: |

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
# v0.5.0
8+
## v1.0.0
9+
10+
ADDED:
11+
12+
- Allow calling sub-orchestrators by name
13+
- Abandon workitems if unhandled exception occurs in client
14+
15+
CHANGED:
16+
17+
- Improve execution logging
18+
- Supported Python versions are now 3.10- 3.14. Python 3.9 is end of life and has been removed.
19+
20+
FIXED:
21+
22+
- Reduce exposure of Entity context internally
23+
24+
## v0.5.0
925

1026
- Added support for Durable Entities
1127

docs/features.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,21 @@ Orchestrations can be suspended using the `suspend_orchestration` client API and
148148

149149
### Retry policies
150150

151-
Orchestrations can specify retry policies for activities and sub-orchestrations. These policies control how many times and how frequently an activity or sub-orchestration will be retried in the event of a transient error.
151+
Orchestrations can specify retry policies for activities and sub-orchestrations. These policies control how many times and how frequently an activity or sub-orchestration will be retried in the event of a transient error.
152+
153+
### Logging configuration
154+
155+
Both the TaskHubGrpcWorker and TaskHubGrpcClient (as well as DurableTaskSchedulerWorker and DurableTaskSchedulerClient for durabletask-azuremanaged) accept a log_handler and log_formatter object from `logging`. These can be used to customize verbosity, output location, and format of logs emitted by these sources.
156+
157+
For example, to output logs to a file called `worker.log` at level `DEBUG`, the following syntax might apply:
158+
159+
```python
160+
log_handler = logging.FileHandler('durable.log', encoding='utf-8')
161+
log_handler.setLevel(logging.DEBUG)
162+
163+
with DurableTaskSchedulerWorker(host_address=endpoint, secure_channel=secure_channel,
164+
taskhub=taskhub_name, token_credential=credential, log_handler=log_handler) as w:
165+
```
166+
167+
**NOTE**
168+
The worker and client output many logs at the `DEBUG` level that will be useful when understanding orchestration flow and diagnosing issues with Durable applications. Before submitting issues, please attempt a repro of the issue with debug logging enabled.

durabletask-azuremanaged/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## v1.0.0
9+
10+
CHANGED:
11+
12+
- Supported Python versions are now 3.10- 3.14. Python 3.9 is end of life and has been removed.
13+
- Updates base dependency to durabletask v1.0.0
14+
- See durabletask changelog for more details
15+
- Allow logging configuration for DurableTaskSchedulerClient
16+
817
## v0.4.0
918

1019
- Updates base dependency to durabletask v0.5.0

durabletask-azuremanaged/durabletask/azuremanaged/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33

4+
import logging
5+
46
from typing import Optional
57

68
from azure.core.credentials import TokenCredential
@@ -18,7 +20,9 @@ def __init__(self, *,
1820
taskhub: str,
1921
token_credential: Optional[TokenCredential],
2022
secure_channel: bool = True,
21-
default_version: Optional[str] = None):
23+
default_version: Optional[str] = None,
24+
log_handler: Optional[logging.Handler] = None,
25+
log_formatter: Optional[logging.Formatter] = None):
2226

2327
if not taskhub:
2428
raise ValueError("Taskhub value cannot be empty. Please provide a value for your taskhub")
@@ -31,5 +35,7 @@ def __init__(self, *,
3135
host_address=host_address,
3236
secure_channel=secure_channel,
3337
metadata=None,
38+
log_handler=log_handler,
39+
log_formatter=log_formatter,
3440
interceptors=interceptors,
3541
default_version=default_version)

durabletask-azuremanaged/durabletask/azuremanaged/worker.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33

4+
import logging
5+
46
from typing import Optional
57

68
from azure.core.credentials import TokenCredential
@@ -28,6 +30,8 @@ class DurableTaskSchedulerWorker(TaskHubGrpcWorker):
2830
concurrency_options (Optional[ConcurrencyOptions], optional): Configuration
2931
for controlling worker concurrency limits. If None, default concurrency
3032
settings will be used.
33+
log_handler (Optional[logging.Handler], optional): Custom logging handler for worker logs.
34+
log_formatter (Optional[logging.Formatter], optional): Custom log formatter for worker logs.
3135
3236
Raises:
3337
ValueError: If taskhub is empty or None.
@@ -52,12 +56,15 @@ class DurableTaskSchedulerWorker(TaskHubGrpcWorker):
5256
parameter is set to None since authentication is handled by the
5357
DTS interceptor.
5458
"""
59+
5560
def __init__(self, *,
5661
host_address: str,
5762
taskhub: str,
5863
token_credential: Optional[TokenCredential],
5964
secure_channel: bool = True,
60-
concurrency_options: Optional[ConcurrencyOptions] = None):
65+
concurrency_options: Optional[ConcurrencyOptions] = None,
66+
log_handler: Optional[logging.Handler] = None,
67+
log_formatter: Optional[logging.Formatter] = None):
6168

6269
if not taskhub:
6370
raise ValueError("The taskhub value cannot be empty.")
@@ -70,5 +77,7 @@ def __init__(self, *,
7077
host_address=host_address,
7178
secure_channel=secure_channel,
7279
metadata=None,
80+
log_handler=log_handler,
81+
log_formatter=log_formatter,
7382
interceptors=interceptors,
7483
concurrency_options=concurrency_options)

durabletask-azuremanaged/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99

1010
[project]
1111
name = "durabletask.azuremanaged"
12-
version = "0.4.0"
12+
version = "1.0.0"
1313
description = "Durable Task Python SDK provider implementation for the Azure Durable Task Scheduler"
1414
keywords = [
1515
"durable",
@@ -18,15 +18,15 @@ keywords = [
1818
"azure"
1919
]
2020
classifiers = [
21-
"Development Status :: 3 - Alpha",
21+
"Development Status :: 5 - Production/Stable",
2222
"Programming Language :: Python :: 3",
2323
"License :: OSI Approved :: MIT License",
2424
]
25-
requires-python = ">=3.9"
25+
requires-python = ">=3.10"
2626
license = {file = "LICENSE"}
2727
readme = "README.md"
2828
dependencies = [
29-
"durabletask>=0.5.0",
29+
"durabletask>=1.0.0",
3030
"azure-identity>=1.19.0"
3131
]
3232

durabletask/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def lock_entities(self, entities: list[EntityInstanceId]) -> Task[EntityLock]:
201201
pass
202202

203203
@abstractmethod
204-
def call_sub_orchestrator(self, orchestrator: Orchestrator[TInput, TOutput], *,
204+
def call_sub_orchestrator(self, orchestrator: Union[Orchestrator[TInput, TOutput], str], *,
205205
input: Optional[TInput] = None,
206206
instance_id: Optional[str] = None,
207207
retry_policy: Optional[RetryPolicy] = None,

0 commit comments

Comments
 (0)