Enable updating the default config parser even after loading luigi #3135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR enables updating the default config parser by updating
LUIGI_CONFIG_PARSER
.Motivation and Context
You can change the default config parser by updating the environment variable
LUIGI_CONFIG_PARSER
.However, you cannot change it after importing
luigi.configuration
because the environment variable is evaluated when loading the module.get_config
is used in many modules, many of which don't allow passing theparser
argument to it.So I changed
luigi.configuration
to allow users to change the default parser even after the module is loaded.Have you tested this? If so, how?
I added a test : https://github.com/spotify/luigi/compare/master...tarohi24:enable_changing_default_parser?expand=1#diff-057c25ffc6418870df3cf372c8de2cf04dd57256dad785ca96ff3eb3046e3ee3R101