-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add explanation for arguments passing #1746
Add explanation for arguments passing #1746
Conversation
@magicpieh28 Thank you for your contribution. Based on the example https://github.com/treasure-data/digdag/blob/master/examples/python_args.dig |
@magicpieh28 Thank you for your update. |
- one more way how to pass arguments - data types of passed arguments
digdag-docs/src/operators/py.md
Outdated
print(f"{required1}: {required2}") | ||
``` | ||
|
||
Finally, you can pass combination of class and mehtod arguments to Python script as the following: |
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.
This behavior is a bit strange.
IIUC, we can't use same argument name between class initializer and method argument for it.
It might be better to add a warning about it.
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.
Sorry for my poor English. Just to be clear, what I tried to explain is in digdag, indeed we can pass both(class and method) arguments at once.
So, on-premise that the above behavior is correct what I understood is I just need to add a warning like ‘But you can not pass combination with the same name.’ instead of modifying the example.
Is this correct? @yoyama
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.
@magicpieh28 Sorry for my comment is not clear.
Yes, your description and example are correct. But I feel a bit strange on this specification on py>
.
Especially, if both initializer of Class and the method have same parameter name, we can't set them separately. (If I understand correctly).
So I propose add description to warn about it as you describe.
Anyway thank you for your contribution.
…fferent names when we pass those through digdag
@yoyama |
|
||
This example assume following Python script: | ||
|
||
```python |
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.
This example does not work by copy and paste it.
Don't we need to import Union
as follows ?
from typing import Union
class MyWorkflow(object):
...
@magicpieh28 Sorry for my late reply. I left a comment. Could you take a look it ? |
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.
LGTM. Thank you for your contribution!
I added explanation about how to run the class or function that needs arguments when using
py>
.Currently, there is no explanation in the digdag documents, but actually we can pass arguments using
_export
. So I thought the explanation needed.