Azure / Azure/azure-functions-durable-python

Tuples passed in parameters are not accessible by name

未关闭
#151 13 条评论 0 个 reaction 已指派 1 人 已指派给 @wenhzha 在 GitHub 查看
Enhancement P2
主要语言
Python
星标
157
派生
70
平均合并
2 天 10 小时
30 天内合并 PR
2

描述

Please note that I may be doing things wrong but it seems like it should work. I had to use deconstruction to make it work.

Please see the commented code in the activity section.

## To reproduce

```
Azure Functions Core Tools (3.0.2630 Commit hash: beec61496e1c5de8aa4ba38d1884f7b48233a7ab)
Function Runtime Version: 3.0.13901.0
```
```
Python 3.7.7
```

#### Orchestrator

```python
from collections import namedtuple
import azure.functions as func
import azure.durable_functions as df

def orchestrator_function(context: df.DurableOrchestrationContext):
Location = namedtuple('Location', ['city', 'state'])
location = Location(city='Seattle', state= 'WA')

weather = yield context.call_activity("GetWeather", location)

# ...

```
#### Activity

```python
import logging
from collections import namedtuple

Location = namedtuple('Location', ['city', 'state'])

def main(location: Location) -> str:
city, state = location
# THIS DOESN'T WORK 👇
# return f"Hello {location.city}, {location.state}!"
return f"Hello {city}, {state}!"
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。