Azure / Azure/azure-functions-durable-python
[Bug] Bug: purge_instance_history_by has incorrect parameter handling and time filter behavior
- Langage dominant
- Python
- Étoiles
- 157
- Forks
- 70
- Merge moyen
- 2 j 10 h
- PR mergées (30 j)
- 2
Description
### 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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par purge_instance_history_by sur DurableOrchestrationClient et examinez le comportement décrit dans l’issue ainsi que l’exigence azure-functions-durable==1.2.10. Utilisez l’appel fourni pour vérifier que l’omission de created_time_from ne produit plus de réponse 400 et que created_time_from et created_time_to définissent un intervalle qui se recoupe.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- azure, python
- Domaine
- api, backend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100