mik-laj commented on a change in pull request #8807:
URL: https://github.com/apache/airflow/pull/8807#discussion_r422776607
##########
File path: backport_packages/setup_backport_packages.py
##########
@@ -422,13 +371,376 @@ def usage():
print(text)
print()
print("You can see all packages configured by specifying
list-backport-packages as first argument")
+ print("You can generate release notes by specifying:"
+ " update-package-release-notes YYYY.MM.DD [PACKAGES]")
+
+
+def is_imported_google_base_hook(name: str) -> bool:
+ if name.endswith("GoogleBaseHook") and name != \
+ "airflow.providers.google.common.hooks.base_google.GoogleBaseHook":
+ return True
+ return False
+
+
+# return list of tuples (objclass, name) containing all subclasses in package
specified
+def find_all_subclasses(full_package: str, class_type,
expected_in_package_name: Optional[str] = None,
+ exclude_class_type=None):
+ import inspect
+ subclasses = set()
+ for global_name, global_object in globals().items():
+ if global_name.startswith(full_package) and
inspect.isclass(global_object):
+ mro = inspect.getmro(global_object)
+ if global_object is not class_type and \
+ class_type in mro and \
+ "example_dags" not in global_name and \
+ (expected_in_package_name is None or expected_in_package_name
in global_name) and \
+ (exclude_class_type is None or exclude_class_type not in mro)
and \
+ global_name not in EXCLUDED_DUPLICATED_OBJECTS and \
+ not is_imported_google_base_hook(global_name) and\
+ global_object.__module__.startswith(full_package):
+ subclasses.add(global_name)
+ return subclasses
+
+
+def get_new_and_moved_objects(objects: Set[str], test_moved_object_dict:
Dict[str, str]):
Review comment:
What does the second parameter of this method do?
----------------------------------------------------------------
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]