Skip to content

Conversation

@kevinhu
Copy link
Contributor

@kevinhu kevinhu commented Jan 25, 2025

Pydantic recommends that @computed_field attributes also be typed with a @property, as otherwise the type checker gets confused: https://docs.pydantic.dev/2.0/usage/computed_fields/

If the computed_field decorator is applied to a bare function (e.g. a function without the @Property or @cached_property decorator) it will wrap the function in property itself. Although this is more concise, you will lose IntelliSense in your IDE, and confuse static type checkers, thus explicit use of @Property is recommended.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 25, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@kevinhu
Copy link
Contributor Author

kevinhu commented Jan 25, 2025

I have read the CLA Document and I hereby sign the CLA

@kevinhu
Copy link
Contributor Author

kevinhu commented Jan 25, 2025

recheck

github-actions bot added a commit that referenced this pull request Jan 25, 2025
@VikParuchuri
Copy link
Member

Thanks for the fix!

@VikParuchuri VikParuchuri merged commit 217439b into datalab-to:master Jan 26, 2025
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants