-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(AIR302): extend the following rules #15015
Merged
Merged
+1,152
−511
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* remove `airflow.datasets.DatasetAliasEvent` * `airflow.datasets.Dataset` → `airflow.sdk.definitions.asset.Asset` * `airflow.Dataset` → `airflow.sdk.definitions.asset.Asset` * `airflow.datasets.DatasetAlias` → `airflow.sdk.definitions.asset.AssetAlias` * `airflow.datasets.DatasetAll` → `airflow.sdk.definitions.asset.AssetAll` * `airflow.datasets.DatasetAny` → `airflow.sdk.definitions.asset.AssetAny` * `airflow.datasets.expand_alias_to_datasets` → `airflow.sdk.definitions.asset.expand_alias_to_assets` * `airflow.datasets.manager` → `airflow.assets.manager` * `airflow.datasets.manager.dataset_manager` → `airflow.assets.manager` * `airflow.datasets.manager.resolve_dataset_manager` → `airflow.assets.resolve_asset_manager` * `airflow.datasets.manager.DatasetManager` → `airflow.assets.AssetManager` * `airflow.listeners.spec.dataset.on_dataset_created` → `airflow.listeners.spec.asset.on_asset_created` * `airflow.listeners.spec.dataset.on_dataset_changed` → `airflow.listeners.spec.asset.on_asset_changed` * `airflow.timetables.datasets.DatasetOrTimeSchedule` → `airflow.timetables.assets.AssetOrTimeSchedule` * `airflow.lineage.hook.DatasetLineageInfo` → `airflow.lineage.hook.AssetLineageInfo` * `airflow.datasets.metadata` → `airflow.sdk.definitions.asset.metadata` * `airflow.auth.managers.models.resource_details.DatasetDetails` → `airflow.auth.managers.models.resource_details.AssetDetails` * `airflow.timetables.simple.DatasetTriggeredTimetable` → `airflow.timetables.simple.AssetTriggeredTimetable` * `airflow.providers.openlineage.utils.utils.DatasetInfo` → `airflow.providers.openlineage.utils.utils.AssetInfo` * `airflow.providers.amazon.aws.datasets.s3.create_dataset` → `airflow.providers.amazon.aws.assets.s3.create_asset` * `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` → `airflow.providers.amazon.aws.assets.s3.convert_asset_to_openlineage` * `airflow.providers.common.io.datasets.file.create_dataset` → `airflow.providers.common.io.assets.file.create_asset` * `airflow.providers.common.io.datasets.file.convert_dataset_to_openlineage` → `airflow.providers.common.io.assets.file.convert_asset_to_openlineage` * `airflow.api_connexion.security.requires_access_dataset` → `airflow.api_connexion.security.requires_access_asset` * `airflow.auth.managers.base_auth_manager.is_authorized_dataset` → `airflow.auth.managers.base_auth_manager.is_authorized_asset` * `airflow.www.auth.has_access_dataset` → `airflow.www.auth.has_access_dataset.has_access_asset` * `airflow.providers.fab.auth_manager.fab_auth_manager.is_authorized_dataset` → `airflow.providers.fab.auth_manager.fab_auth_manager.is_authorized_asset` * `airflow.providers.openlineage.utils.utils.translate_airflow_dataset` → `airflow.providers.openlineage.utils.utils.translate_airflow_asset` * `airflow.providers.amazon.auth_manager.avp.entities.AvpEntities.DATASET` → `airflow.providers.amazon.auth_manager.avp.entities.AvpEntities.ASSET` * `airflow.security.permissions.RESOURCE_DATASET` → `airflow.security.permissions.RESOURCE_ASSET`
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
AIR302 | 16 | 16 | 0 | 0 | 0 |
* `airflow.providers.amazon.aws.datasets.s3.create_dataset` → `airflow.providers.amazon.aws.assets.s3.create_asset` * `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` → `airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage` * `airflow.providers.amazon.aws.assets.s3.sanitize_uri` → `airflow.providers.amazon.aws.assets.s3.sanitize_uri` * `airflow.providers.common.io.datasets.file.convert_dataset_to_openlineage` → `airflow.providers.common.io.assets.file.convert_asset_to_openlineage` * `airflow.providers.common.io.datasets.file.create_dataset` → `airflow.providers.common.io.assets.file.create_asset` * `airflow.providers.common.io.datasets.file.sanitize_uri` → `airflow.providers.common.io.assets.file.sanitize_uri` * `airflow.providers.google.datasets.bigquery.sanitize_uri` → `airflow.providers.google.assets.bigquery.sanitize_uri` * `airflow.providers.google.datasets.gcs.create_dataset` → `airflow.providers.google.assets.gcs.create_asset` * `airflow.providers.google.datasets.gcs.sanitize_uri` → `airflow.providers.google.assets.gcs.sanitize_uri` * `airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage` → `airflow.providers.google.assets.gcs.convert_asset_to_openlineage` * `airflow.providers.postgres.datasets.postgres.sanitize_uri` → `airflow.providers.postgres.assets.postgres.sanitize_uri` * `airflow.providers.mysql.datasets.mysql.sanitize_uri` → `airflow.providers.mysql.assets.mysql.sanitize_uri` * `airflow.providers.trino.datasets.trino.sanitize_uri` → `airflow.providers.trino.assets.trino.sanitize_uri`
dhruvmanila
added
rule
Implementing or modifying a lint rule
preview
Related to preview mode features
labels
Dec 16, 2024
… fix airflow.sensors.external_task.ExternalTaskSensorLink error
dcreager
added a commit
that referenced
this pull request
Dec 17, 2024
* main: [red-knot] Explicitly test diagnostics are emitted for unresolvable submodule imports (#15035) Fix stale File status in tests (#15030) [red-knot] Basic support for other legacy `typing` aliases (#14998) feat(AIR302): extend the following rules (#15015) [`perflint`] Simplify finding the loop target in `PERF401` (#15025) [red-knot] Avoid undeclared path when raising conflicting declarations (#14958)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
airflow.api_connexion.security.requires_access_dataset
→airflow.api_connexion.security.requires_access_asset
airflow.auth.managers.base_auth_manager.is_authorized_dataset
→airflow.auth.managers.base_auth_manager.is_authorized_asset
airflow.auth.managers.models.resource_details.DatasetDetails
→airflow.auth.managers.models.resource_details.AssetDetails
airflow.lineage.hook.DatasetLineageInfo
→airflow.lineage.hook.AssetLineageInfo
airflow.security.permissions.RESOURCE_DATASET
→airflow.security.permissions.RESOURCE_ASSET
airflow.www.auth.has_access_dataset
→airflow.www.auth.has_access_dataset.has_access_asset
airflow.datasets.DatasetAliasEvent
airflow.datasets.Dataset
→airflow.sdk.definitions.asset.Asset
airflow.Dataset
→airflow.sdk.definitions.asset.Asset
airflow.datasets.DatasetAlias
→airflow.sdk.definitions.asset.AssetAlias
airflow.datasets.DatasetAll
→airflow.sdk.definitions.asset.AssetAll
airflow.datasets.DatasetAny
→airflow.sdk.definitions.asset.AssetAny
airflow.datasets.metadata
→airflow.sdk.definitions.asset.metadata
airflow.datasets.expand_alias_to_datasets
→airflow.sdk.definitions.asset.expand_alias_to_assets
airflow.datasets.manager.dataset_manager
→airflow.assets.manager
airflow.datasets.manager.resolve_dataset_manager
→airflow.assets.resolve_asset_manager
airflow.datasets.manager.DatasetManager
→airflow.assets.AssetManager
airflow.listeners.spec.dataset.on_dataset_created
→airflow.listeners.spec.asset.on_asset_created
airflow.listeners.spec.dataset.on_dataset_changed
→airflow.listeners.spec.asset.on_asset_changed
airflow.timetables.simple.DatasetTriggeredTimetable
→airflow.timetables.simple.AssetTriggeredTimetable
airflow.timetables.datasets.DatasetOrTimeSchedule
→airflow.timetables.assets.AssetOrTimeSchedule
airflow.providers.amazon.auth_manager.avp.entities.AvpEntities.DATASET
→airflow.providers.amazon.auth_manager.avp.entities.AvpEntities.ASSET
airflow.providers.amazon.aws.datasets.s3.create_dataset
→airflow.providers.amazon.aws.assets.s3.create_asset
airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage
→airflow.providers.amazon.aws.datasets.s3.convert_dataset_to_openlineage
airflow.providers.amazon.aws.datasets.s3.sanitize_uri
→airflow.providers.amazon.aws.assets.s3.sanitize_uri
airflow.providers.common.io.datasets.file.convert_dataset_to_openlineage
→airflow.providers.common.io.assets.file.convert_asset_to_openlineage
airflow.providers.common.io.datasets.file.sanitize_uri
→airflow.providers.common.io.assets.file.sanitize_uri
airflow.providers.common.io.datasets.file.create_dataset
→airflow.providers.common.io.assets.file.create_asset
airflow.providers.google.datasets.bigquery.sanitize_uri
→airflow.providers.google.assets.bigquery.sanitize_uri
airflow.providers.google.datasets.gcs.create_dataset
→airflow.providers.google.assets.gcs.create_asset
airflow.providers.google.datasets.gcs.sanitize_uri
→airflow.providers.google.assets.gcs.sanitize_uri
airflow.providers.google.datasets.gcs.convert_dataset_to_openlineage
→airflow.providers.google.assets.gcs.convert_asset_to_openlineage
airflow.providers.fab.auth_manager.fab_auth_manager.is_authorized_dataset
→airflow.providers.fab.auth_manager.fab_auth_manager.is_authorized_asset
airflow.providers.openlineage.utils.utils.DatasetInfo
→airflow.providers.openlineage.utils.utils.AssetInfo
airflow.providers.openlineage.utils.utils.translate_airflow_dataset
→airflow.providers.openlineage.utils.utils.translate_airflow_asset
airflow.providers.postgres.datasets.postgres.sanitize_uri
→airflow.providers.postgres.assets.postgres.sanitize_uri
airflow.providers.mysql.datasets.mysql.sanitize_uri
→airflow.providers.mysql.assets.mysql.sanitize_uri
airflow.providers.trino.datasets.trino.sanitize_uri
→airflow.providers.trino.assets.trino.sanitize_uri
In additional to the newly added rules above, the message for
airflow.contrib.*
andairflow.subdag.*
has been extended,airflow.sensors.external_task.ExternalTaskSensorLink
error has been fixed and the test fixture has been reorganizedTest Plan
A test fixture is included in the PR.