This is an automated email from the ASF dual-hosted git repository.

xddeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 27449ba  Replace dictionary creation with dictionary literal (#13474)
27449ba is described below

commit 27449ba4616fd33387d9a421a7e353c236d9e99d
Author: Kaxil Naik <[email protected]>
AuthorDate: Tue Jan 5 07:19:21 2021 +0000

    Replace dictionary creation with dictionary literal (#13474)
    
    Instead of:
    
    ```
    ctx = {}
    ctx['filename'] = filename
    ```
    
    we can use:
    
    ```
    ctx = {'filename': filename}
    ```
---
 airflow/utils/log/file_processor_handler.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/airflow/utils/log/file_processor_handler.py 
b/airflow/utils/log/file_processor_handler.py
index d05617a..a1b47f2 100644
--- a/airflow/utils/log/file_processor_handler.py
+++ b/airflow/utils/log/file_processor_handler.py
@@ -90,8 +90,7 @@ class FileProcessorHandler(logging.Handler):
             filename = os.path.join("native_dags", os.path.relpath(filename, 
airflow_directory))
         else:
             filename = os.path.relpath(filename, self.dag_dir)
-        ctx = {}
-        ctx['filename'] = filename
+        ctx = {'filename': filename}
 
         if self.filename_jinja_template:
             return self.filename_jinja_template.render(**ctx)

Reply via email to