Skip to content
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

Create: Allow to pass in transient data on instance creation #1110

Merged

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jan 29, 2025

Changelog Description

It is possible to set transient data on instance creation.

Additional info

Create plugins cannot fill attribute definitions on instance initialization, if their logic is based on transient data.

Testing notes:

  1. Validate code changes.

@iLLiCiTiT iLLiCiTiT self-assigned this Jan 29, 2025
@iLLiCiTiT iLLiCiTiT added the type: enhancement Improvement of existing functionality or minor addition label Jan 29, 2025
@ynbot ynbot added the size/XS label Jan 29, 2025
@iLLiCiTiT iLLiCiTiT requested review from BigRoy and antirotor January 29, 2025 09:46
Copy link
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flawless - seems to work perfectly.

I do think for the transient_data I'm not entirely sure whether the key is required to be a str because it'd support any key a regular dict would support? Although I don't think the type hint is problematic in practice.

BigRoy added a commit to ynput/ayon-silhouette that referenced this pull request Jan 29, 2025
@iLLiCiTiT
Copy link
Member Author

I'm not entirely sure whether the key is required to be a str because it'd support any key a regular dict would support?

I would say it is reasonable to not do that at the first level of transient data.

@iLLiCiTiT iLLiCiTiT merged commit 34fbf68 into develop Jan 29, 2025
15 checks passed
@iLLiCiTiT iLLiCiTiT deleted the enhancement/allow-transient-data-on-instnace-init branch January 29, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants