-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix error with LuigiTomlParser usage in S3Client #3076
base: master
Are you sure you want to change the base?
Conversation
@@ -61,6 +61,23 @@ def read(self, config_paths): | |||
|
|||
return self.data | |||
|
|||
def defaults(self): |
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.
solution 1: fill lacking functions to LuigiTomlParser. This is just dummy function so it's not my preferred one.
(will add tests if preferred by reviewers)
try: | ||
config = dict(configuration.get_config().items('s3')) | ||
config = dict(luigi_config['s3']) |
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.
solution 2: change usage to generic one to use existing __getitem__
and only take defaults when it's meaningful (ex. LuigiConfigParser) instead of creating dummy function. (my pref. Will add tests if reviewers also think so)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If closed, you may revisit when your time allows and reopen! Thank you for your contributions. |
Description
My attempt to address issue of toml usage error in S3Client from #2996
I'm providing two solutions to choose from, one to fill lacking functions into LuigiTomlParser and another to change the usage into more generic one. While I prefer the second one, when the reviewers prefer one over another, I'll add tests for it.
LuigiConfigParser is built on top of Python's ConfigParser, which is MutableMapping at the end.
LuigiTomlParser is using toml (the module), and it does not provide a comparable class but rather provide load/dump via decoder/encoder.
They work a bit differently. A touch to BaseParser may be needed on a long term because there may be other issues due to differences in their functionalities (not being addressed in this PR).
Motivation and Context
Resolves error on S3Client when attempting to use toml. It would give this before:
Have you tested this? If so, how?
I ran my jobs with this code and it works for me.
I'm happy to add tests when one solution is preferred over another by the reviewers.