-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[airflow]: extend removed method calls (AIR302) #15054
[airflow]: extend removed method calls (AIR302) #15054
Conversation
* `airflow.datasets.manager.DatasetManager.register_dataset_change` → `airflow.assets.manager.AssetManager.register_asset_change` * `airflow.datasets.manager.DatasetManager.create_datasets` → `airflow.assets.manager.AssetManager.create_assets` * `airflow.datasets.manager.DatasetManager.notify_dataset_created` → `airflow.assets.manager.AssetManager.notify_asset_created` * `airflow.datasets.manager.DatasetManager.notify_dataset_changed` → `airflow.assets.manager.AssetManager.notify_asset_changed` * `airflow.datasets.manager.DatasetManager.notify_dataset_alias_created` → `airflow.assets.manager.AssetManager.notify_asset_alias_created` * `airflow.providers.amazon.auth_manager.aws_auth_manager.AwsAuthManager.is_authorized_dataset` → `airflow.providers.amazon.auth_manager.aws_auth_manager.AwsAuthManager.is_authorized_asset` * `airflow.lineage.hook.HookLineageCollector.create_dataset` → `airflow.lineage.hook.HookLineageCollector.create_asset` * `airflow.lineage.hook.HookLineageCollector.add_input_dataset` → `airflow.lineage.hook.HookLineageCollector.add_input_asset` * `airflow.lineage.hook.HookLineageCollector.add_output_dataset` → `airflow.lineage.hook.HookLineageCollector.dd_output_asset` * `airflow.lineage.hook.HookLineageCollector.collected_datasets` → `airflow.lineage.hook.HookLineageCollector.collected_assets` * `airflow.providers_manager.ProvidersManager.initialize_providers_dataset_uri_resources` → `airflow.providers_manager.ProvidersManager.initialize_providers_asset_uri_resources`
|
@@ -607,6 +714,8 @@ pub(crate) fn removed_in_3(checker: &mut Checker, expr: &Expr) { | |||
if let Some(qualname) = checker.semantic().resolve_qualified_name(func) { | |||
removed_argument(checker, &qualname, arguments); | |||
}; | |||
|
|||
removed_method(checker, func); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we skip calling removed_method
if the resolved_qualified_name
call was successful or does it need both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g.,
from airflow.datasets.manager import DatasetManager
d = DatasetManager()
d.register_dataset_change()
needs 2 warnings
- import error
- method call error
## Summary Smaller nits follow up to #15054 because I wasn't able to push to the branch directly. ## Test Plan `cargo test`
Summary
Airflow 3.0 removes various deprecated functions, members, modules, and other values. They have been deprecated in 2.x, but the removal causes incompatibilities that we want to detect. This PR deprecates the following names and add a function for removed methods
airflow.datasets.manager.DatasetManager.register_dataset_change
→airflow.assets.manager.AssetManager.register_asset_change
airflow.datasets.manager.DatasetManager.create_datasets
→airflow.assets.manager.AssetManager.create_assets
airflow.datasets.manager.DatasetManager.notify_dataset_created
→airflow.assets.manager.AssetManager.notify_asset_created
airflow.datasets.manager.DatasetManager.notify_dataset_changed
→airflow.assets.manager.AssetManager.notify_asset_changed
airflow.datasets.manager.DatasetManager.notify_dataset_alias_created
→airflow.assets.manager.AssetManager.notify_asset_alias_created
airflow.providers.amazon.auth_manager.aws_auth_manager.AwsAuthManager.is_authorized_dataset
→airflow.providers.amazon.auth_manager.aws_auth_manager.AwsAuthManager.is_authorized_asset
airflow.lineage.hook.HookLineageCollector.create_dataset
→airflow.lineage.hook.HookLineageCollector.create_asset
airflow.lineage.hook.HookLineageCollector.add_input_dataset
→airflow.lineage.hook.HookLineageCollector.add_input_asset
airflow.lineage.hook.HookLineageCollector.add_output_dataset
→airflow.lineage.hook.HookLineageCollector.dd_output_asset
airflow.lineage.hook.HookLineageCollector.collected_datasets
→airflow.lineage.hook.HookLineageCollector.collected_assets
airflow.providers_manager.ProvidersManager.initialize_providers_dataset_uri_resources
→airflow.providers_manager.ProvidersManager.initialize_providers_asset_uri_resources
Test Plan
A test fixture is included in the PR.