Skip to content

Commit d53ec10

Browse files
committed
Merge branch 'dev'
2 parents 59032d7 + 489d802 commit d53ec10

File tree

118 files changed

+1699
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1699
-722
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can find more information at the following links:
1515

1616
* [Azure Functions overview](https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview)
1717
* [Azure Functions Python developers guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python)
18-
* [Durable Functions overview](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview)
18+
* [Durable Functions overview](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=python)
1919

2020
A durable function, or _orchestration_, is a solution made up of different types of Azure Functions:
2121

@@ -27,27 +27,22 @@ Durable Functions' function types and features are documented in-depth [here.](h
2727

2828
## Current limitations
2929

30-
We're actively working on Python support for Durable Functions and we expect a Public Preview announcement in Q2 CY2020. The following are the current known limitations.
30+
Python support for Durable Functions is currently in public preview. The following are the current known limitations.
3131

3232
### Functionality
3333

34-
* `DurableOrchestrationContext.create_timer()` is not yet supported (coming soon [#35](https://github.com/Azure/azure-functions-durable-python/issues/35))
3534
* Sub-orchestrations are not yet supported (planned [#62](https://github.com/Azure/azure-functions-durable-python/issues/62))
3635
* Durable Entities are not yet supported (not yet planned [#96](https://github.com/Azure/azure-functions-durable-python/issues/96))
3736

3837
### Tooling
3938

40-
* Python Durable Functions requires updated versions of Azure Functions Core Tools that includes Python worker [1.1.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/1.1.0), templates ([bundle-1.2.0](https://github.com/Azure/azure-functions-templates/releases/tag/bundle-1.2.0)), and extension bundles ([1.2.0](https://github.com/Azure/azure-functions-extension-bundles/releases/tag/1.2.0)) that are not yet released (ETA May 2020). Use the VS Code dev container in the [Getting Started](#getting-started) section to access a development environment with the required versions of the tools installed.
41-
42-
### Deployment
43-
44-
* Python Durable Functions requires an updated version of the Azure Functions Python language worker ([1.1.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/1.1.0)) that is not yet available in Azure. Deploy your Python Durable Functions apps in containers (requires Premium or App Service plans). (Linux consumption plan support ETA May 2020)
39+
* Python Durable Functions requires [Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local) version 3.0.2630 or higher.
4540

4641
## Getting Started
4742

4843
Follow these instructions to get started with Durable Functions in Python:
4944

50-
**🚀 [Python Durable Functions quickstart](https://aka.ms/pythondurable)**
45+
**🚀 [Python Durable Functions quickstart](https://docs.microsoft.com/azure/azure-functions/durable/quickstart-python-vscode)**
5146

5247
## Samples
5348

azure/durable_functions/models/DurableHttpRequest.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
from typing import Dict, Any
1+
from typing import Dict, Union, Optional
22

3-
from azure.durable_functions.models import TokenSource
3+
from azure.durable_functions.models.TokenSource import TokenSource
44
from azure.durable_functions.models.utils.json_utils import add_attrib, add_json_attrib
55

66

77
class DurableHttpRequest:
88
"""Data structure representing a durable HTTP request."""
99

10-
def __init__(self, method: str, uri: str, content: str = None, headers: Dict[str, str] = None,
11-
token_source: TokenSource = None):
10+
def __init__(self, method: str, uri: str, content: Optional[str] = None,
11+
headers: Optional[Dict[str, str]] = None,
12+
token_source: Optional[TokenSource] = None):
1213
self._method: str = method
1314
self._uri: str = uri
14-
self._content: str = content
15-
self._headers: Dict[str, str] = headers
16-
self._token_source: TokenSource = token_source
15+
self._content: Optional[str] = content
16+
self._headers: Optional[Dict[str, str]] = headers
17+
self._token_source: Optional[TokenSource] = token_source
1718

1819
@property
1920
def method(self) -> str:
@@ -26,29 +27,29 @@ def uri(self) -> str:
2627
return self._uri
2728

2829
@property
29-
def content(self) -> str:
30+
def content(self) -> Optional[str]:
3031
"""Get the HTTP request content."""
3132
return self._content
3233

3334
@property
34-
def headers(self) -> Dict[str, str]:
35+
def headers(self) -> Optional[Dict[str, str]]:
3536
"""Get the HTTP request headers."""
3637
return self._headers
3738

3839
@property
39-
def token_source(self) -> TokenSource:
40+
def token_source(self) -> Optional[TokenSource]:
4041
"""Get the source of OAuth token to add to the request."""
4142
return self._token_source
4243

43-
def to_json(self) -> Dict[str, Any]:
44+
def to_json(self) -> Dict[str, Union[str, int]]:
4445
"""Convert object into a json dictionary.
4546
4647
Returns
4748
-------
48-
Dict[str, Any]
49+
Dict[str, Union[str, int]]
4950
The instance of the class converted into a json dictionary
5051
"""
51-
json_dict = {}
52+
json_dict: Dict[str, Union[str, int]] = {}
5253
add_attrib(json_dict, self, 'method')
5354
add_attrib(json_dict, self, 'uri')
5455
add_attrib(json_dict, self, 'content')

azure/durable_functions/models/DurableOrchestrationBindings.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from typing import Dict
2+
from typing import Dict, Optional
33

44
from azure.durable_functions.models.FunctionContext import FunctionContext
55

@@ -13,11 +13,13 @@ class DurableOrchestrationBindings:
1313

1414
# parameter names are as defined by JSON schema and do not conform to PEP8 naming conventions
1515
def __init__(self, taskHubName: str, creationUrls: Dict[str, str],
16-
managementUrls: Dict[str, str], rpcBaseUrl: str = None, **kwargs):
16+
managementUrls: Dict[str, str], rpcBaseUrl: Optional[str] = None, **kwargs):
1717
self._task_hub_name: str = taskHubName
1818
self._creation_urls: Dict[str, str] = creationUrls
1919
self._management_urls: Dict[str, str] = managementUrls
20-
self._rpc_base_url: str = rpcBaseUrl
20+
# TODO: we can remove the Optional once we drop support for 1.x,
21+
# this is always provided in 2.x
22+
self._rpc_base_url: Optional[str] = rpcBaseUrl
2123
self._client_data = FunctionContext(**kwargs)
2224

2325
@property
@@ -36,7 +38,7 @@ def management_urls(self) -> Dict[str, str]:
3638
return self._management_urls
3739

3840
@property
39-
def rpc_base_url(self) -> str:
41+
def rpc_base_url(self) -> Optional[str]:
4042
"""Get the base url communication between out of proc workers and the function host."""
4143
return self._rpc_base_url
4244

0 commit comments

Comments
 (0)