-
Notifications
You must be signed in to change notification settings - Fork 12
🏛️Product base types: add support for product base types in API #255
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
🏛️Product base types: add support for product base types in API #255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for product base types across the API, including new type definitions, query filters, and API operations.
- Introduces ProductBaseTypeDict and default fields for product base types.
- Updates API functions to support filtering, querying, and creating/updating products with the new product base type.
- Extends GraphQL queries and entity hub operations to incorporate product base types.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ayon_api/typing.py | Added a new TypedDict for product base types. |
| ayon_api/server_api.py | Extended product-related functions to support product base types. |
| ayon_api/operations.py | Updated product entity creation and update operations to include base type; noted a naming typo. |
| ayon_api/graphql_queries.py | Added GraphQL queries for product base types. |
| ayon_api/entity_hub.py | Modified product entity handling to incorporate product base type with a documentation update. |
| ayon_api/constants.py | Added default fields for product base types. |
| ayon_api/_api.py | Updated API functions to include product base type filters. |
| ayon_api/init.py | Re-exported new functions related to product base types. |
Comments suppressed due to low confidence (2)
ayon_api/operations.py:117
- Correct the misspelled parameter name from 'produc_base_type' to 'product_base_type' to ensure consistency with the documentation and usage.
produc_base_type: str,
ayon_api/entity_hub.py:447
- Update the docstring to reflect that the function creates a product entity rather than a task object for clarity.
'''Create a task object and add it to the entity hub.
ayon_api/server_api.py
Outdated
| return parsed_data.get("project", {}).get("productBaseTypes", []) | ||
|
|
||
|
|
||
| def get_product_base_type_names( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function probably does not have to be implemented in server api.
It does 2 different things, either returns what get_project_product_base_types does or what get_products does. Looks like a helper functions somewhere in pipeline, but even there I can't imagine the usecase. I would not include it here.
| name: str | ||
| color: Optional[str] | ||
| icon: Optional[str] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if value is not None: | ||
| update_data[key] = value | ||
|
|
||
| update_data = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check if product type is supported and raise an error if is passed and is not supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still same question.
…oduct-base-types-add-support
…es-add-support' into enhancement/254-product-base-types-add-support
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
…pport # Conflicts: # ayon_api/_api_helpers/projects.py
Changelog Description
Adding support for product base types.
Additional review information
Once the product base types are established, they should be marked mandatory in function arguments and
product_typeoptional.Testing notes:
This shouldn't affect "normal" functionality. If product base type is provided, it should be successfully queried or written to/from server.
Note
Closes: #254
Requires: ynput/ayon-backend#615