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

[Feature Request] Create official Pydantic contrib module #621

Open
cretz opened this issue Aug 26, 2024 · 2 comments
Open

[Feature Request] Create official Pydantic contrib module #621

cretz opened this issue Aug 26, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Aug 26, 2024

Describe the solution you'd like

Pydantic is popular/common enough and people are struggling with https://github.com/temporalio/samples-python/tree/main/pydantic_converter enough (or just that we haven't shown V2 yet: temporalio/samples-python#97), that we should just make a temporalio.contrib.pydantic module as a pydantic extra similar to what we have done with opentelemetry.

It should contain:

  • A JSON encoding payload converter that works with Pydantic models to/from JSON
  • A default payload converter that puts Pydantic converter just above the default JSON encoding payload converter in the list
  • A default data converter using that default payload converter
  • Some way to solve the datetime issue mentioned in the sample's README (maybe just a built-in Pydantic-safe worker runner that customizes the sandbox for them if there's no better way)
    • We might also want the converter to warn if it can when it sees a Pydantic datetime and the fix is not enabled in the sandbox and there's no better way to fix the issue
@cretz cretz added the enhancement New feature or request label Aug 26, 2024
@temporalio temporalio deleted a comment Aug 26, 2024
@temporalio temporalio deleted a comment Aug 26, 2024
@Kilo59
Copy link

Kilo59 commented Jan 4, 2025

@cretz Is there any movement on this?
I almost passed on Temporal in favor of FastStream and Tasik because of the relative friction of using the Python SDK in comparison.

@cretz
Copy link
Member Author

cretz commented Jan 6, 2025

I am afraid not yet, but it is on the near-term backlog. We will look into prioritizing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@cretz @Kilo59 and others