Skip to content

Filter format inconsistent with UI #831

Open

Description

@wk9874

Description of Bug

When you copy a filter with multiple different items from the UI, you get:
"folder.path == /GS2/test_data && metrics.mtm.last == 1"

But if you submit that via the Client class, you get an error:

RuntimeError: Retrieval of runs failed for url 'https://uk.simvue.io/api/runs?filters=%5B%22folder.path+%3D%3D+%2FGS2%2Ftest_data+%26%26+metrics.mtm.last+%3D%3D+1%22%5D&return_basic=True&return_metrics=True&return_alerts=False&return_system=False&return_metadata=True&count=100&start=0' with status 422: Invalid filter

We believe this is because the python API instead expects a list of filters, not '&&'. Could we fix it so that the python API accepts either format and converts it appropriately?

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to web UI
  2. Add two filters
  3. Copy filter string with the button on the UI, and paste into client.get_runs()
  4. See error

Expected behavior

Runs retrieved correctly

Actual Behaviour

422 error

Setup

  • OS: Ubuntu
  • Python version: 3.10

Additional context

Add any other context about the problem here.

Activity

  1. kzscisoft commented on Aug 11, 2025

    @kzscisoft
    Collaborator

    There is a branch kzscisoft/819-contains-option-get-artifacts which proposes a new Filter object, I think this would be an extension of it, the appropriate filter class having a from_string method.

  2. wk9874 commented on Aug 13, 2025

    @wk9874
    CollaboratorAuthor

    For now cant we just make it consistent between UI and API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogWaiting to be resolvedbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions