molcay commented on issue #61009: URL: https://github.com/apache/airflow/issues/61009#issuecomment-3842148459
Hi @shahar1, Thank you for opening this issue. It makes total sense to start introducing these changes to the provider. As you mentioned, we should approach this with caution to avoid breaking workflows. As a starting point, I’d like to highlight the [deprecation policy](https://airflow.apache.org/docs/apache-airflow-providers-google/stable/deprecation-policy.html) for the Google provider. I’ve reviewed the current implementation and found that while no changes are required at the SDK level, we do need to perform several updates within the provider itself. I suggest the following implementation plan: - **Audit Occurrences:** Find every occurrence of `stackdriver` in class names (Operators, Hooks, Links, Log Handlers, etc.). - **Service Mapping:** Map these classes to their correct modern service: Cloud Logging, Cloud Monitoring, or Cloud Observability. - **Module Organization:** Create separate modules for different services if they don’t already exist (e.g., `airflow.providers.google.cloud.operators.monitoring`). - **Class Refactoring:** + **Rename:** Update the class names to use proper naming instead of `Stackdriver`(e.g., rename `StackdriverListAlertPoliciesOperator` to `CloudMonitoringListAlertPoliciesOperator`). + **Relocate:** Move the renamed class to the correct module. + **Maintain Backward Compatibility:** Create a stub in the original `stackdriver` module that inherits from the new class using the old name. + **Deprecation:** Apply the `@deprecated` decorator to the old class names (use the `deprecated` class from `airflow.providers.google.common.deprecated` module) + Example Implementation: ```python from airflow.exceptions import AirflowProviderDeprecationWarning from airflow.providers.google.common.deprecated import deprecated from airflow.providers.google.cloud.operators.monitoring import CloudMonitoringListAlertPoliciesOperator @deprecated( planned_removal_date="September 30, 2026", use_instead="airflow.providers.google.cloud.operators.monitoring.CloudMonitoringListAlertPoliciesOperator", reason="Stackdriver operators are deprecated. They will be removed on September 30, 2026, " "in favor of their Cloud Monitoring/Observability equivalents.", category=AirflowProviderDeprecationWarning, ) class StackdriverListAlertPoliciesOperator(CloudMonitoringListAlertPoliciesOperator): pass ``` + Update docstrings. + Add/update unit tests (including tests for the deprecation warnings). + Fix system tests. By following this approach, we ensure that current users encounter no disruptions beyond the deprecation warning. This gives everyone enough time to transition to the new classes. After the grace period (at least 6 months), we can: - Remove the deprecated classes. - Bump the major version. - Release the updated provider. > I hope this is helpful for anyone looking to implement this change -- 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]
