Azure / Azure/azure-functions-durable-python
[Bug] Bug: purge_instance_history_by has incorrect parameter handling and time filter behavior
- Vorherrschende Sprache
- Python
- Sterne
- 157
- Forks
- 70
- Ø Merge
- 2 T. 10 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
### 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.
Beitragsleitfaden
Rechercherichtung
Beginne bei purge_instance_history_by auf DurableOrchestrationClient und überprüfe das im Issue beschriebene Verhalten im Zusammenhang mit der Anforderung azure-functions-durable==1.2.10. Verwende den bereitgestellten Aufruf, um zu verifizieren, dass das Weglassen von created_time_from keine 400-Antwort mehr erzeugt und dass created_time_from und created_time_to ein sich überschneidendes Intervall definieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- azure, python
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100