jianqiuhuang opened a new issue #16597:
URL: https://github.com/apache/airflow/issues/16597


   **Apache Airflow version**: 2.1.0
   
   **What happened**:
   Airflow logging assume dict_key is type `str`
   ```
       logging.info("Dictionary where key is int type: %s", 
modified_table_mapping)
     File "/usr/lib64/python3.6/logging/__init__.py", line 1902, in info
       root.info(msg, *args, **kwargs)
     File "/usr/lib64/python3.6/logging/__init__.py", line 1308, in info
       self._log(INFO, msg, args, **kwargs)
     File "/usr/lib64/python3.6/logging/__init__.py", line 1444, in _log
       self.handle(record)
     File "/usr/lib64/python3.6/logging/__init__.py", line 1453, in handle
       if (not self.disabled) and self.filter(record):
     File "/usr/lib64/python3.6/logging/__init__.py", line 720, in filter
       result = f.filter(record)
     File 
"/bb/bin/airflow_env/lib/python3.6/site-packages/airflow/utils/log/secrets_masker.py",
 line 157, in filter
       record.__dict__[k] = self.redact(v)
     File 
"/bb/bin/airflow_env/lib/python3.6/site-packages/airflow/utils/log/secrets_masker.py",
 line 193, in redact
       return {dict_key: self.redact(subval, dict_key) for dict_key, subval in 
item.items()}
     File 
"/bb/bin/airflow_env/lib/python3.6/site-packages/airflow/utils/log/secrets_masker.py",
 line 193, in <dictcomp>
       return {dict_key: self.redact(subval, dict_key) for dict_key, subval in 
item.items()}
     File 
"/bb/bin/airflow_env/lib/python3.6/site-packages/airflow/utils/log/secrets_masker.py",
 line 189, in redact
       if name and should_hide_value_for_key(name):
     File 
"/bb/bin/airflow_env/lib/python3.6/site-packages/airflow/utils/log/secrets_masker.py",
 line 74, in should_hide_value_for_key
       name = name.strip().lower()
   AttributeError: 'int' object has no attribute 'strip'
   ```
   
   **How to reproduce it**:
   Define a dictionary where the type of keys is `int` and print it in any 
Airflow tasks.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to