-
Notifications
You must be signed in to change notification settings - Fork 500
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
generate python constructor types for s3 services #5451
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.
It's a nice addition IMO, but it does add more maintenance burden. I'd be happy to include it if we can add a pytest to at least validate it to some extend, like it has specified all possible arguments. But it does not seem easy to do because the Python binding api does not expose any information about the config of each service.
Maybe we could also consider exposing XXXConfig
to python and also accept that in Operator(config=XXXConfig())
so it's strongly typed?
Some arguments are optional, I don't think this is possible?
Then how we type |
To clarify, I meant all possible config arguments are included in
Just like any other |
in that case,I think we can generate Operator.init overloads from config directly? |
Totally |
I'll have a try |
Node.js, C++, and Java bindings all have similar issues. I'm wondering if there is a general solution for this. |
I don't know rust very well, so I write a very simple rust script to generat pyi for s3. I'm guessing maybe most of these rust code can be improved. I do not know internal details about opendal., but looks like S3Config doesn' match options in docs https://opendal.apache.org/docs/rust/opendal/services/struct.S3.html |
Hi, I like this direction. I believe we can integrate it into our workflow more effectively. Let me give it a try. |
Hi, @trim21. I plan to add some helper utilities to our |
ok |
oops, didn't notice there is already a empty dev crate. |
I think we should generate some kind of ir and generate types for each languages from ir |
100%! Working on this now. |
I'll close this for now and wait for your pr. feel free to cherry pick code if you like |
Which issue does this PR close?
Closes #.
Rationale for this change
Not sure if this is a good idea for opendal developers or not, this add extra burden in keeping types synced with builder.
What changes are included in this PR?
add type annotation for s3 operator.
Are there any user-facing changes?
Yes, add argument typing checking for users using s3 service.