Azure / Azure/azure-functions-durable-python

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

Đang mở
#533 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug fixed-in-v2
Ngôn ngữ chính
Python
Star
157
Fork
70
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu từ purge_instance_history_by trên DurableOrchestrationClient và xem xét hành vi được mô tả trong issue cùng với yêu cầu azure-functions-durable==1.2.10. Sử dụng lệnh gọi được cung cấp để xác minh rằng việc bỏ qua created_time_from không còn tạo ra phản hồi 400 và rằng created_time_from cùng created_time_to xác định một khoảng giao nhau.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
azure, python
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.