-
Notifications
You must be signed in to change notification settings - Fork 32
Add has_function_id filter to function job collection filtering ✨ #7746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
458754e
Add filter for list function collections
wvangeit 5e65f2a
Simplify funccol filter db query
wvangeit 1fee38c
Add filter for list function collections
wvangeit 8a5a8da
Simplify funccol filter db query
wvangeit b042adc
Fix getting keywords for filtering
wvangeit 326e085
Merge branch 'add_funccoll_filter' of github.com:wvangeit/osparc-simc…
wvangeit 47cf30e
Merge branch 'master' into add_funccoll_filter
wvangeit 0727d36
Update openapi specs
wvangeit 6317f93
Merge branch 'add_funccoll_filter' of github.com:wvangeit/osparc-simc…
wvangeit a0ec134
Merge branch 'master' into add_funccoll_filter
wvangeit 2af1289
Merge branch 'add_funccoll_filter' of github.com:wvangeit/osparc-simc…
wvangeit b9effb6
Merge branch 'master' into add_funccoll_filter
wvangeit bc4c582
Fixes based on PR comments
wvangeit b75e6f4
Merge branch 'add_funccoll_filter' of github.com:wvangeit/osparc-simc…
wvangeit 36fe6a7
Merge branch 'master' into add_funccoll_filter
wvangeit 14589fb
Constrain has function id string
wvangeit e22c9f9
Fix typecheck in functions
wvangeit 6c98b8f
Merge branch 'master' into add_funccoll_filter
wvangeit 3ded73e
Update openapi specs
wvangeit 00878c5
Triggering github action in PR
wvangeit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...server/src/simcore_service_api_server/api/dependencies/models_schemas_function_filters.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| from typing import Annotated, Any | ||
|
|
||
| from fastapi import Query | ||
| from models_library.functions import FunctionJobCollectionsListFilters | ||
| from pydantic.fields import FieldInfo | ||
|
|
||
|
|
||
| def _get_query_params(field: FieldInfo) -> dict[str, Any]: | ||
wvangeit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| params = {} | ||
|
|
||
| if field.description: | ||
| params["description"] = field.description | ||
| if field.examples: | ||
| params["example"] = next( | ||
| (example for example in field.examples if "*" in example), field.examples[0] | ||
| ) | ||
| return params | ||
|
|
||
|
|
||
| def get_function_job_collections_filters( | ||
wvangeit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # pylint: disable=unsubscriptable-object | ||
| has_function_id: Annotated[ | ||
| str | None, | ||
| Query( | ||
| **_get_query_params( | ||
| FunctionJobCollectionsListFilters.model_fields["has_function_id"] | ||
| ) | ||
| ), | ||
| ] = None, | ||
| ) -> FunctionJobCollectionsListFilters: | ||
| return FunctionJobCollectionsListFilters( | ||
| has_function_id=has_function_id, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.