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: [email protected]

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

Reply via email to