Azure / Azure/azure-functions-durable-python

Tuples passed in parameters are not accessible by name

Abierto
#151 13 comentarios 0 reacciones 1 asignado Asignado a @wenhzha Ver en GitHub
Enhancement P2
Lenguaje dominante
Python
Estrellas
157
Forks
70
Merge medio
2 d 10 h
PR fusionados (30 d)
2

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.