kerrydc commented on code in PR #26603:
URL: https://github.com/apache/beam/pull/26603#discussion_r1192737735
##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -201,9 +201,11 @@ def get_postprocess_fns(self) -> Iterable[Callable[[Any],
Any]]:
def set_environment_vars(self):
"""Sets environment variables using a dictionary provided via kwargs.
- Keys are the env variable name, and values are the env variable value."""
- for env_variable, env_value in self._env_vars.items():
- os.environ[env_variable] = env_value
+ Keys are the env variable name, and values are the env variable value.
+ Child ModelHandler classes should set _env_vars via kwargs in __init__"""
+ if '_env_vars' in self.__dict__:
Review Comment:
I changed it to:
env_vars = getattr(self, '_env_vars', {})
for env_variable, env_value in env_vars:
otherwise I got errors about getattr not being iterable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]