Skip to content

feat(LAB-3534): add stepIdIn and stepStatusIn filters#1885

Merged
BlueGrizzliBear merged 1 commit into
mainfrom
feature/lab-3534-aau-i-can-use-either-the-degraded-mode-or-workflow-v2-mode
Apr 24, 2025
Merged

feat(LAB-3534): add stepIdIn and stepStatusIn filters#1885
BlueGrizzliBear merged 1 commit into
mainfrom
feature/lab-3534-aau-i-can-use-either-the-degraded-mode-or-workflow-v2-mode

Conversation

@BlueGrizzliBear
Copy link
Copy Markdown
Contributor

No description provided.

@BlueGrizzliBear BlueGrizzliBear added the enhancement New feature or request label Apr 15, 2025
@BlueGrizzliBear BlueGrizzliBear self-assigned this Apr 15, 2025
@BlueGrizzliBear BlueGrizzliBear force-pushed the feature/lab-3534-aau-i-can-use-either-the-degraded-mode-or-workflow-v2-mode branch 3 times, most recently from 8ff3ca9 to 6e105e6 Compare April 16, 2025 15:00
@RuellePaul
Copy link
Copy Markdown
Contributor

Here are some highlights of my tests :


>>> assets = kili.assets(project_id=project_id, step_status_in=['TO_DO'])

UserWarning: Field status requested : request fields step and stepStatus instead for this project

-> we should not pass status by default in fields if the project is in workflow V2, to avoid a warning if user does not specify fields explicitly


>>> assets = kili.assets(project_id=project_id, step_in=['Labeling'])
>>> print(len(assets))
6
>>> assets = kili.assets(project_id=project_id, step_in=['Reviewing 1'])
>>> print(len(assets))
1
>>> assets = kili.assets(project_id=project_id, step_in=['????'])
>>> print(len(assets))
7

-> I think we should add a validator on step_in to only allow valid values, and raise if the step name is invalid (like for step_status_in)
-> Suggestion : rename step_in to step_name_in ? At first, I thought it was step ids - might be confusing for user
-> Should not the step name be Label and Review 1 ? (as you're currently refactoring it, I don't know if it's need to be in this MR)


>>> assets = kili.assets(project_id=project_id, step_status_in=['DOING'])
>>> print(len(assets))
1

>>> assets = kili.assets(project_id=project_id, status_in=['ONGOING'])
>>> print(len(assets))
UserWarning: Field status requested : request fields step and stepStatus instead for this project
0

-> I think it would be better to raise if user request fields forbidden in workflow V2 (and vice-versa) to avoid incorrect results


>>> assets = kili.assets(project_id=project_id, step_status_in=['SKIPPED'], skipped=True)
>>> print(len(assets))
UserWarning: Filter skipped given : use filter step_status_in with the SKIPPED status instead for this project
1
>>> assets = kili.assets(project_id=project_id, skipped=True)
>>> print(len(assets))
1

-> I think this user warning should be present even if the user did not specify step_status_in

Comment thread src/kili/presentation/client/asset.py Outdated
@BlueGrizzliBear BlueGrizzliBear force-pushed the feature/lab-3534-aau-i-can-use-either-the-degraded-mode-or-workflow-v2-mode branch from 6e105e6 to f749f84 Compare April 17, 2025 12:59
@BlueGrizzliBear
Copy link
Copy Markdown
Contributor Author

As discussed with @paulruelle :

  • "not pass status by default in fields" : not resolved here. We will not modify this because the default project are not workflowV2 yet. When it will be the case, we can modify accordingly.
  • "validator on step_in" : added a validation on step names
  • "rename step_in to step_name_in" : renamed accordingly
  • "Should not the step name be Label and Review 1" : this is not addressed here : ticket Lab-3565 does the trick.
  • "I think it would be better to raise if user request fields forbidden in workflow V2 (and vice-versa) to avoid incorrect results" : there are a few cases. In some cases, we trigger a warning, in other we trigger errors (as identified on the ticket)
  • "I think this user warning should be present even if the user did not specify step_status_in" : added a verification in this case
  • "I would move step_in and step_status_in just below status_in, to enhance documentation readability" : moved sections closer to each other

@BlueGrizzliBear BlueGrizzliBear merged commit a5cc12a into main Apr 24, 2025
12 checks passed
@BlueGrizzliBear BlueGrizzliBear deleted the feature/lab-3534-aau-i-can-use-either-the-degraded-mode-or-workflow-v2-mode branch April 24, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants