-
Notifications
You must be signed in to change notification settings - Fork 32
Add more function job filters 🎨 #8187
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
wvangeit
merged 26 commits into
ITISFoundation:master
from
wvangeit:add_function_job_filters
Aug 13, 2025
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
c836380
Pagination endpoint jobs
wvangeit 77ab078
Merge branch 'master' into add_function_job_filters
wvangeit 065cccd
Test filter function jobs by ids
wvangeit 48575cb
Merge branch 'master' into add_function_job_filters
wvangeit 051eb45
Add changelog messages
wvangeit 0697c65
Update openapi specs
wvangeit 79fc1c7
Merge branch 'master' into add_function_job_filters
wvangeit a2cfda0
Merge branch 'master' into add_function_job_filters
wvangeit 4d65e86
Fix linting
wvangeit 91d92b8
Merge branch 'add_function_job_filters' of github.com:wvangeit/osparc…
wvangeit 3390efe
Revert studies_jobs change
wvangeit 283427e
Fix job id type
wvangeit 58829d9
Fix job type in test
wvangeit b455ca7
Fix import in test
wvangeit 34db9ca
Make job listing test more complex
wvangeit 07ad50e
Add an AbstractPage return type
wvangeit 23e5027
Add more AbstractPage return values in functions api
wvangeit 8bba5bd
Merge branch 'master' into add_function_job_filters
wvangeit cb78209
Update openapi specs
wvangeit faf78d4
Add 2 extra function rpc tests
wvangeit 87ac9b2
Merge branch 'master' into add_function_job_filters
wvangeit 9dfe883
Fix version strings
wvangeit 1786ca1
services/api-server version: 0.10.0 → 0.11.0
wvangeit b6bb8e8
Mention new version in more files
wvangeit f5faca0
Update openapi specs
wvangeit 18de9fa
Merge branch 'master' into add_function_job_filters
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.10.0 | ||
| 0.11.0 |
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
45 changes: 45 additions & 0 deletions
45
services/api-server/src/simcore_service_api_server/_service_function_jobs.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,45 @@ | ||
| from dataclasses import dataclass | ||
|
|
||
| from common_library.exclude import as_dict_exclude_none | ||
| from models_library.functions import ( | ||
| FunctionID, | ||
| FunctionJobCollectionID, | ||
| FunctionJobID, | ||
| RegisteredFunctionJob, | ||
| ) | ||
| from models_library.products import ProductName | ||
| from models_library.rest_pagination import PageMetaInfoLimitOffset, PageOffsetInt | ||
| from models_library.rpc_pagination import PageLimitInt | ||
| from models_library.users import UserID | ||
| from simcore_service_api_server.services_rpc.wb_api_server import WbApiRpcClient | ||
|
|
||
|
|
||
| @dataclass(frozen=True, kw_only=True) | ||
| class FunctionJobService: | ||
wvangeit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| user_id: UserID | ||
| product_name: ProductName | ||
| _web_rpc_client: WbApiRpcClient | ||
|
|
||
| async def list_function_jobs( | ||
| self, | ||
| *, | ||
| filter_by_function_id: FunctionID | None = None, | ||
| filter_by_function_job_ids: list[FunctionJobID] | None = None, | ||
| filter_by_function_job_collection_id: FunctionJobCollectionID | None = None, | ||
| pagination_offset: PageOffsetInt | None = None, | ||
| pagination_limit: PageLimitInt | None = None, | ||
| ) -> tuple[list[RegisteredFunctionJob], PageMetaInfoLimitOffset]: | ||
| """Lists all function jobs for a user with pagination""" | ||
|
|
||
| pagination_kwargs = as_dict_exclude_none( | ||
| pagination_offset=pagination_offset, pagination_limit=pagination_limit | ||
| ) | ||
|
|
||
| return await self._web_rpc_client.list_function_jobs( | ||
| user_id=self.user_id, | ||
| product_name=self.product_name, | ||
| filter_by_function_id=filter_by_function_id, | ||
| filter_by_function_job_ids=filter_by_function_job_ids, | ||
| filter_by_function_job_collection_id=filter_by_function_job_collection_id, | ||
| **pagination_kwargs, | ||
| ) | ||
40 changes: 40 additions & 0 deletions
40
services/api-server/src/simcore_service_api_server/_service_functions.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,40 @@ | ||
| from dataclasses import dataclass | ||
|
|
||
| from common_library.exclude import as_dict_exclude_none | ||
| from models_library.functions import RegisteredFunction | ||
| from models_library.products import ProductName | ||
| from models_library.rest_pagination import ( | ||
| MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE, | ||
| PageMetaInfoLimitOffset, | ||
| PageOffsetInt, | ||
| ) | ||
| from models_library.rpc_pagination import PageLimitInt | ||
| from models_library.users import UserID | ||
| from simcore_service_api_server.services_rpc.wb_api_server import WbApiRpcClient | ||
|
|
||
| DEFAULT_PAGINATION_LIMIT = MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE - 1 | ||
|
|
||
|
|
||
| @dataclass(frozen=True, kw_only=True) | ||
| class FunctionService: | ||
| user_id: UserID | ||
| product_name: ProductName | ||
| _web_rpc_client: WbApiRpcClient | ||
|
|
||
| async def list_functions( | ||
| self, | ||
| *, | ||
| pagination_offset: PageOffsetInt | None = None, | ||
| pagination_limit: PageLimitInt | None = None, | ||
| ) -> tuple[list[RegisteredFunction], PageMetaInfoLimitOffset]: | ||
| """Lists all functions for a user with pagination""" | ||
|
|
||
| pagination_kwargs = as_dict_exclude_none( | ||
| pagination_offset=pagination_offset, pagination_limit=pagination_limit | ||
| ) | ||
|
|
||
| return await self._web_rpc_client.list_functions( | ||
| user_id=self.user_id, | ||
| product_name=self.product_name, | ||
| **pagination_kwargs, | ||
| ) |
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.