Add an explanation on an obscure bit of the code.

This commit is contained in:
Pablo Martin 2023-01-19 09:54:44 +01:00
parent 0945d5ce7d
commit 7af50228b5

View file

@ -24,6 +24,9 @@ def _needs_env_data(method: Callable) -> Callable:
"""
def wrapper(self, *args, **kwargs):
# Many methods that use this decorator used to provide the option of passing in
# an s3_reader different than the default one. Here, we check if the kwargs
# contain one and, if so, use that instead of the default one.
self.fetch_env_data(kwargs.get("s3_reader", None))
return method(self, *args, **kwargs)