Closed nersonu closed 2 years ago
Alternatively, I would suggest doing away with read_environ() and only using luigi's style${ENVVAR}.
Yes, I personally, absolutely agree to your suggestion. But plz let me care about backward compatibilities a little 🙇
Sorry. There was a bug in multiple variable expansion, so I have fixed it a bit (https://github.com/m3dev/gokart/pull/272/commits/9cc41dd8ee3c339de36743a4d3cafa911e4741b5).
@nersonu
I've carefully checked how read_environment() currently used in our company, and found more risks than benefits. Following is my surveys and thoughts.
https://docs.google.com/presentation/d/1Vq9EvpvTlwtMoZsOLrSljLencxx2xqfyNmlGb42SOXg/edit?usp=sharing
Finally, I strongly agree to your suggestion.
Alternatively, I would suggest doing away with read_environ() and only using luigi's style${ENVVAR}.
Could you change this PRs to "only using luigi's style${ENVVAR}" ? We will make new release version after this breaking changes update :)
@Hi-king
Thanks for your survey and cool choices!
Could you change this PRs to "only using luigi's style${ENVVAR}" ? We will make new release version after this breaking changes update :)
I'd like to do it. 👍
I'm going to remove read_environ()
and also remove check_config()
and commit, is there a problem?
In check_config()
, it looks like to me the function to check that the %(envvar)s
style environment variable is not set.
https://github.com/m3dev/gokart/blob/9524265d9b6c266b9ca49d440fb4ca3bfb3e3acd/gokart/utils.py#L14-L20
@nersonu I've merged this PR. Thx again for your careful debugging :)
@nersonu Thank you for your GREAT contribution!
When I want to use the local stack, I try to specify 'endpoint_url' in the 's3' section, but it fails because
boto3.resources()
reads the environment variable.The following is an example of a param.ini.
When I run it in this state, it outputs an error as follows. (
<ENV>
is the environment variable.)This is because ConfigParser reads all environment variables with
read_environ()
in utils.py.Suggestion
~I created this PR as the first idea for this measure. My proposed change overrides the Interpolation in luigi's ConfigParser and expands the environment variables denoted by
%()s
first. I abolishedread_environ()
and applied theBasicEnvironmentInterpolation
to ConfigParser inset_environ_interpolation()
.~Alternatively, I would suggest doing away with
read_environ()
and only using luigi's style${ENVVAR}
. Please review!Only Use lugi-style
${ENVVAR}
(Feb. 10, 22)I did away with
read_environ()
and only using luigi-style${ENVVAR}
. I removedread_environ()
and also removecheck_config()
. Incheck_config()
, it looks like to me the function to check that the%(envvar)s
style environment variable is not set.Thanks to @Hi-king for agreeing to this suggestion :)