I'm coding a python script, to import data from aws s3 bucket. In some machines, it returns None type has no attribute get. While debugging pyathena, I have found that this error comes from a lambda expression in util.py file, in the following function:
def retry_api_call(func, config, logger=None, *args, **kwargs):
retry = tenacity.Retrying(
retry=retry_if_exception(
lambda e: getattr(e, "response", {}).get("Error", {}).get("Code", None)
in config.exceptions
if e
else False
),
stop=stop_after_attempt(config.attempt),
wait=wait_exponential(
multiplier=config.multiplier,
max=config.max_delay,
exp_base=config.exponential_base,
),
after=after_log(logger, logger.level) if logger else None,
reraise=True,
)
return retry(func, *args, **kwargs)
Anyone has some idea?
Thanks