Azure / Azure/azure-functions-durable-python

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

オープン
#533 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug fixed-in-v2
主要言語
Python
スター
157
フォーク
70
平均マージ
2日 10時間
マージ済み PR(30日)
2

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

DurableOrchestrationClient の purge_instance_history_by から始め、issue に記載された動作を azure-functions-durable==1.2.10 の要件と併せて確認してください。提供された呼び出しを使用して、created_time_from を省略しても 400 応答が発生しなくなったこと、および created_time_from と created_time_to が交差する区間を定義することを検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, python
領域
api, backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。