-
Notifications
You must be signed in to change notification settings - Fork 790
[FEAT] : Motia Python Types #665
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
base: main
Are you sure you want to change the base?
Conversation
|
@riturajFi is attempting to deploy a commit to the motia Team on Vercel. A member of the Team first needs to authorize it. |
2cc67e3 to
ef637c1
Compare
|
@sergiofilhowz would like your review on the PR regarding functionality, code quality, edge cases etc on this PR. |
|
Hey @riturajFi, Thanks for your contribution - This is big! Team is going to review this as soon as possible, currently working on a big release for the cloud. |
80c38d6 to
e304aec
Compare
|
Hey @riturajFi, how's it going? Do you need any help here? |
Hi @rohitg00 sorry for the delay - this will be done shortly |
8757c84 to
4f08e58
Compare
0b3739d to
a29b6df
Compare
|
Hi @sergiofilhowz @mfpiccolo @rohitg00 would love a review of the code and approach |
a29b6df to
f10bec2
Compare
|
Thanks @riturajFi, we will review it this week. Thanks again. |
|
Thank you @riturajFi I checked your PR and it looks great, I need to test to understand how it ties to Motia Cloud and Motia self-host deployment. This PR is a solid contribution, but I appreciate your patience and hope you understand this can take some time to be merged. |
| import importlib.util | ||
| import os | ||
| import platform | ||
| from dataclasses import asdict, is_dataclass |
Check notice
Code scanning / CodeQL
Unused import Note
Import of 'is_dataclass' is not used.
| class ApiMiddleware[ | ||
| TBody = object, | ||
| TEmitData = Never, | ||
| TResult = object, |
Check failure
Code scanning / CodeQL
Syntax error Error
| from motia_middleware import compose_middleware | ||
| from motia_rpc_stream_manager import RpcStreamManager | ||
| from motia_dot_dict import DotDict | ||
| from dataclasses import asdict, is_dataclass |
Check notice
Code scanning / CodeQL
Unused import Note
Import of 'is_dataclass' is not used.
Absolutely! If the current approach proves effective, my next steps will be as follows:
Current ConcernsThe current workflow involves generating types in the following sequence: This indirect approach was necessary to maintain consistency between the Python types and the TypeScript generics used in Motia operations. All things considered, with a bit more work—perhaps over the weekend—everything should be fully aligned and complete. |
Solves: #485
Description
This update introduces strongly typed Python definitions for:
Input Types
API request and response objects
FlowContext types across all step files
It also resolves the previous issue where nested objects were incorrectly inferred as unknown in Python type definitions.