Azure / Azure/azure-functions-durable-python

Tuples passed in parameters are not accessible by name

Ouverte
#151 13 commentaires 0 réactions 1 personne assignée Assignée à @wenhzha Voir sur GitHub
Enhancement P2
Langage dominant
Python
Étoiles
157
Forks
70
Merge moyen
2 j 10 h
PR mergées (30 j)
2

Description

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}!"
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.