Azure / Azure/azure-functions-durable-python
[Bug] Bug: purge_instance_history_by has incorrect parameter handling and time filter behavior
- Lingua principale
- Python
- Stelle
- 157
- Fork
- 70
- Merge medio
- 2g 10h
- PR unite (30g)
- 2
Descrizione
### Expected Behavior
The created_time_from parameter should be optional, and the time filters should be combined with an intersection (AND) to allow precise time intervals.
### Actual Behavior
Observe that the API returns a 400 Bad Request error.
### Steps to Reproduce
Use the following code to call purge_instance_history_by
```shell
await client.purge_instance_history_by(
created_time_to=datetime.now(timezone.utc) - timedelta(days=1),
runtime_status=[
df.OrchestrationRuntimeStatus.Completed,
df.OrchestrationRuntimeStatus.Failed,
df.OrchestrationRuntimeStatus.Terminated,
],
)
```
Observe that the API returns a 400 Bad Request error.
### requirements.txt file
```shell
azure-functions-durable==1.2.10
```
### **Description:**
When using the _purge_instance_history_by_ method in the _DurableOrchestrationClient_ I encountered the following issues:
1. **Missing Mandatory Parameter:**
The created_time_from parameter is treated as optional in the SDK, but it is actually mandatory in the underlying API. If created_time_from is not
provided, the API returns a 400 Bad Request error.
2. **Time Filter Behavior:**
The time filters (created_time_from and created_time_to) are combined with a union (OR) instead of an intersection (AND). This makes it impossible
to define precise time intervals for purging.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da purge_instance_history_by su DurableOrchestrationClient e verifica il comportamento descritto nell’issue insieme al requisito azure-functions-durable==1.2.10. Usa la chiamata fornita per verificare che omettere created_time_from non produca più una risposta 400 e che created_time_from e created_time_to definiscano un intervallo intersecante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- api, backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100