Azure / Azure/azure-functions-durable-python

[Bug] Bug: purge_instance_history_by has incorrect parameter handling and time filter behavior

Abierto
#533 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug fixed-in-v2
Lenguaje dominante
Python
Estrellas
157
Forks
70
Merge medio
2 d 10 h
PR fusionados (30 d)
2

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza por purge_instance_history_by en DurableOrchestrationClient y revisa el comportamiento descrito en el issue junto con el requisito azure-functions-durable==1.2.10. Usa la llamada proporcionada para verificar que omitir created_time_from ya no produce una respuesta 400 y que created_time_from y created_time_to definen un intervalo que se intersecta.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
azure, python
Área
api, backend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.