ashb commented on a change in pull request #13439:
URL: https://github.com/apache/airflow/pull/13439#discussion_r551353793
##########
File path: setup.py
##########
@@ -640,15 +672,21 @@ def find_requirements_for_alias(alias_to_look_for:
Tuple[str, str]) -> List[str]
raise Exception(f"The extra {new_extra} is missing for alias
{deprecated_extra}")
-# Add extras for all deprecated aliases. Requirements for those deprecated
aliases are the same
-# as the extras they are replaced with
-for alias, extra in EXTRAS_DEPRECATED_ALIASES.items():
- requirements = EXTRAS_REQUIREMENTS.get(extra) if extra != '' else []
- if requirements is None:
- raise Exception(f"The extra {extra} is missing for deprecated alias
{alias}")
- # Note the requirements are not copies - those are the same lists as for
the new extras. This is intended.
- # Thanks to that if the original extras are later extended with providers,
aliases are extended as well.
- EXTRAS_REQUIREMENTS[alias] = requirements
+def add_extras_for_all_deprecated_aliases() -> None:
+ """
+ Add extras for all deprecated aliases. Requirements for those deprecated
aliases are the same
+ as the extras they are replaced with.
+ The requirements are not copies - those are the same lists as for the new
extras. This is intended.
+ Thanks to that if the original extras are later extended with providers,
aliases are extended as well.
+ """
+ for alias, extra in EXTRAS_DEPRECATED_ALIASES.items():
+ requirements = EXTRAS_REQUIREMENTS.get(extra) if extra != '' else []
+ if requirements is None:
+ raise Exception(f"The extra {extra} is missing for deprecated
alias {alias}")
+ EXTRAS_REQUIREMENTS[alias] = requirements
+
+
+add_extras_for_all_deprecated_aliases()
Review comment:
Do these need to be called at the top level, or could/should the be
called in the "if __main__" block instead?
----------------------------------------------------------------
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]