Skip to content

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

@RamoRema96

Description

@RamoRema96

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

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions