-
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
Luigi task does not accept dict defined in TOML Config file. #2538
Comments
Thanks for opening this bug @adamist521 @orsinium Can you look into this since you added the TOML config support? |
@dlstadther, assign me this task, please. I'll debug this later. @adamist521, thank you for detailed report. This is very helpful, I guess. |
@adamist521, you can use fixes from #2540. Your test cases works for it. Thank you for issue submission :) |
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. |
We have to merge #2540... |
Overview
Using TOML for configuration file and faced error parsing dict.
Tried three ways to parse dict (key-value pairs) on TOML config.
Case 1: Parsing with
luigi.Parameter
insideluigi.Task
.-> Task fails but somehow outputs expected results.
Case 2: Parsing with
luigi.Parameter
insideluigi.Config
.-> Task success with warning and outputs expected results.
Case 3: Parsing with
luigi.DictParameter
insideluigi.Config
.-> Task Fails and no creates no output.
Using Case 2 for now... (Because it works even with warnings...)
Should be problem with
string
,dict
andJSON
stuff...Any suggestions on what the problem is or where to start with if I wanted to commit?
Reproduction
Using
test.py
&config.toml
for all of the cases.Environment
python 3.7.0
luigi 2.7.8
toml 0.9.6
Files
Luigi Task Python Script (includes all Task)
test.py
TOML config file
config.toml
Case 1.
Case 1: Parsing with
luigi.Parameter
insideluigi.Task
.Command:
PYTHONPATH='.' LUIGI_CONFIG_PARSER='toml' LUIGI_CONFIG_PATH='config.toml' pipenv run luigi --module test TestCase1 --local-scheduler
CLI Output:
Result:
Outputs failure on CLI but task outputs expected text file.
cat case1.txt
->
text: sample text, dict: {'key1': 'value1', 'key2': 'value2'}
Case 2.
Parsing with
luigi.Parameter
insideluigi.Config
.Command:
CLI Output:
Result:
CLI outputs Warning but works as expected.
cat case2.txt
->
text: sample text, dict: {'ckey1': 'value1', 'ckey2': 'value2'}
Case3.
Parsing with
luigi.DictParameter
insideluigi.Config
.Command:
PYTHONPATH='.' LUIGI_CONFIG_PARSER='toml' LUIGI_CONFIG_PATH='config.toml' pipenv run luigi --module test TestCase3 --local-scheduler
CLI Output:
Result:
Task fails and produces no outputs.
The text was updated successfully, but these errors were encountered: