Skip to content
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

Add AWS project structure tests (re: AIP-47) #23630

Merged
merged 1 commit into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/providers/amazon/aws/sensors/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __init__(
):
warnings.warn(
"""
S3PrefixSensor is deprecated.
S3KeySizeSensor is deprecated.
Please use `airflow.providers.amazon.aws.sensors.s3.S3KeySensor`.
""",
DeprecationWarning,
Expand Down
58 changes: 58 additions & 0 deletions tests/always/test_project_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,64 @@ def test_missing_assets(self):
super().test_missing_assets()


class TestAmazonProviderProjectStructure(ExampleCoverageTest):
PROVIDER = "amazon"
CLASS_DIRS = ProjectStructureTest.CLASS_DIRS
o-nikolas marked this conversation as resolved.
Show resolved Hide resolved

BASE_CLASSES = {
'airflow.providers.amazon.aws.operators.rds.RdsBaseOperator',
'airflow.providers.amazon.aws.operators.sagemaker.SageMakerBaseOperator',
'airflow.providers.amazon.aws.sensors.dms.DmsTaskBaseSensor',
'airflow.providers.amazon.aws.sensors.emr.EmrBaseSensor',
'airflow.providers.amazon.aws.sensors.rds.RdsBaseSensor',
'airflow.providers.amazon.aws.sensors.sagemaker.SageMakerBaseSensor',
}

MISSING_EXAMPLES_FOR_CLASSES = {
# DMS examples DAGs are currently in development
'airflow.providers.amazon.aws.operators.dms.DmsDescribeTasksOperator',
'airflow.providers.amazon.aws.operators.dms.DmsStopTaskOperator',
# EMR legitimately missing, needs development
'airflow.providers.amazon.aws.operators.emr.EmrModifyClusterOperator',
'airflow.providers.amazon.aws.sensors.emr.EmrContainerSensor',
# S3 Exasol transfer difficult to test, see: https://github.com/apache/airflow/issues/22632
'airflow.providers.amazon.aws.transfers.exasol_to_s3.ExasolToS3Operator',
# S3 legitimately missing, needs development
'airflow.providers.amazon.aws.transfers.gcs_to_s3.GCSToS3Operator',
# Glue Catalog sensor difficult to test
'airflow.providers.amazon.aws.sensors.glue_catalog_partition.GlueCatalogPartitionSensor',
}

DEPRECATED_CLASSES = {
'airflow.providers.amazon.aws.operators.athena.AWSAthenaOperator',
'airflow.providers.amazon.aws.operators.batch.AwsBatchOperator',
'airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator',
'airflow.providers.amazon.aws.operators.ecs.ECSOperator',
'airflow.providers.amazon.aws.operators.eks.EKSCreateClusterOperator',
'airflow.providers.amazon.aws.operators.eks.EKSCreateFargateProfileOperator',
'airflow.providers.amazon.aws.operators.eks.EKSCreateNodegroupOperator',
'airflow.providers.amazon.aws.operators.eks.EKSDeleteClusterOperator',
'airflow.providers.amazon.aws.operators.eks.EKSDeleteFargateProfileOperator',
'airflow.providers.amazon.aws.operators.eks.EKSDeleteNodegroupOperator',
'airflow.providers.amazon.aws.operators.eks.EKSPodOperator',
'airflow.providers.amazon.aws.operators.emr_containers.EMRContainerOperator',
'airflow.providers.amazon.aws.operators.glue.AwsGlueJobOperator',
'airflow.providers.amazon.aws.operators.glue_crawler.AwsGlueCrawlerOperator',
'airflow.providers.amazon.aws.operators.sqs.SQSPublishOperator',
'airflow.providers.amazon.aws.sensors.eks.EKSClusterStateSensor',
'airflow.providers.amazon.aws.sensors.eks.EKSFargateProfileStateSensor',
'airflow.providers.amazon.aws.sensors.eks.EKSNodegroupStateSensor',
'airflow.providers.amazon.aws.sensors.emr_containers.EMRContainerSensor',
'airflow.providers.amazon.aws.sensors.glue.AwsGlueJobSensor',
'airflow.providers.amazon.aws.sensors.glue_catalog_partition.AwsGlueCatalogPartitionSensor',
'airflow.providers.amazon.aws.sensors.glue_crawler.AwsGlueCrawlerSensor',
'airflow.providers.amazon.aws.sensors.s3.S3KeySizeSensor',
'airflow.providers.amazon.aws.sensors.s3.S3PrefixSensor',
'airflow.providers.amazon.aws.sensors.sqs.SQSSensor',
'airflow.providers.amazon.aws.transfers.mysql_to_s3.MySQLToS3Operator',
}


class TestElasticsearchProviderProjectStructure(ExampleCoverageTest):
PROVIDER = "elasticsearch"
CLASS_DIRS = {"hooks"}
Expand Down