simvue-io / simvue-io/python-api

Filter format inconsistent with UI

Aperta
#831 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

backlog bug
Lingua principale
Python
Stelle
4
Fork
1
Merge medio
5g 8h
PR unite (30g)
4

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal punto di ingresso Client.get_runs() indicato nella riproduzione e segui come viene formattato il relativo argomento di filtro per la richiesta dei runs. Riproduci l’esempio con due filtri dell’issue, quindi verifica che sia la stringa && dell’interfaccia utente sia il formato di lista esistente recuperino i runs senza un errore 422.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.