You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eumiro (via GitHub)" <gi...@apache.org> on 2023/08/06 18:49:36 UTC

[GitHub] [airflow] eumiro opened a new pull request, #33160: Refactor: Simplify code in configuration.py

eumiro opened a new pull request, #33160:
URL: https://github.com/apache/airflow/pull/33160

   (no comment)


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #33160: Refactor: Simplify code in configuration.py

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #33160:
URL: https://github.com/apache/airflow/pull/33160#discussion_r1289645750


##########
airflow/configuration.py:
##########
@@ -473,13 +473,7 @@ def get_sections_including_defaults(self) -> list[str]:
 
         :return: list of section names
         """
-        my_own_sections = self.sections()
-
-        all_sections_from_defaults = list(self.configuration_description.keys())
-        for section in my_own_sections:
-            if section not in all_sections_from_defaults:
-                all_sections_from_defaults.append(section)
-        return all_sections_from_defaults
+        return list({**dict.fromkeys(self.configuration_description), **dict.fromkeys(self.sections())})

Review Comment:
   I wonder if this should be further improved to
   
   ```python
   import itertools
   
   list(dict.fromkeys(itertools.chain(self.configuration_description, self.sections())))
   ```
   
   but maybe this is too minor.



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk merged pull request #33160: Refactor: Simplify code in configuration.py

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #33160:
URL: https://github.com/apache/airflow/pull/33160


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org