You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/06/22 17:08:58 UTC

[GitHub] [airflow] jianqiuhuang opened a new issue #16597: Airflow logging secrets masker assume dict_key is type `str`

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:
users@infra.apache.org



[GitHub] [airflow] ashb closed issue #16597: Airflow logging secrets masker assumes dict_key is type `str`

Posted by GitBox <gi...@apache.org>.
ashb closed issue #16597:
URL: https://github.com/apache/airflow/issues/16597


   


-- 
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #16597: Airflow logging secrets masker assumes dict_key is type `str`

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #16597:
URL: https://github.com/apache/airflow/issues/16597#issuecomment-866247732


   should be easy to fix by str() 


-- 
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:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #16597: Airflow logging secrets masker assume dict_key is type `str`

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #16597:
URL: https://github.com/apache/airflow/issues/16597#issuecomment-866171285


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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:
users@infra.apache.org