Skip to content

Consistently name Amazon provider operators files #20296

Closed

Description

@ferruzzi

Description

Follow-up to
Restructure Amazon provider operators files #20139 as discussed with @eladkal

Amazon Operators, Hooks, and Sensors are inconsistently named regarding acronym capitalization and whether to prefix with AWS or not.

An incomplete list for example: we have SnsPublishOperator but we capitalize the acronyms in SQSPublishOperator and ECSOperator. We prefix AwsGlueCrawlerOperator and AwsBatchOperator in lowercase, AWSAthenaOperator is prefixed in uppercase, and no prefix at all on GlacierCreateJobOperatoror CloudFormationCreateStackOperator

Correct naming conventions are listed in AIP 21 cases 3-4 and case 6.

The sensors/operators class names should not have Aws/AWS as part of the class name and only the first letter of the acronyms should be capitalized.

So:
SnsPublishOperator -> No change
SQSPublishOperator -> SqsPublishOperator
AwsBatchOperator -> BatchOperator
AWSAthenaOperator -> AthenaOperator
etc...

Use case/motivation

For each task:
-Rename the operator
-Deprecate the old name
--Add to tests/deprecated_classes.py
--Add to the KNOWN_DEPRECATED_MESSAGES section of dev/provider_packages/prepare_provider_packages.py
-Correct any references to the old name in docstrings and docs files
-Correct all references in tests
-Correct references in example dags

Changes Required:

Current New Name
AWSAthenaOperator AthenaOperator
AwsBatchOperator BatchOperator
AWSDataSyncOperator DataSyncOperator
ECSProtocol EcsProtocol
ECSTaskLogFetcher EcsTaskLogFetcher
ECSOperator EcsOperator
EKS***Operator (all of them) Eks***Operator
SQSPublishOperator SqsPublishOperator
EKS***Sensor (all of them) Eks***Sensor
AwsRedshiftClusterSensor RedshiftClusterSensor
SQSSensor SqsSensor
AWSAthenaHook AthenaHook
AWSCloudFormationHook CloudFormationHook
AWSDataSyncHook DataSyncHook
AwsDynamoDBHook DynamoDBHook
EKSHook EksHook
AwsFirehoseHook (in kinesis.py) FirehoseHook
AwsLambdaHook LambdaHook
SESHook SesHook
AwsSnsHook SnsHook
SQSHook SqsHook

Action Items:

To be verified (recently changed in the linked campaign):

DMS - good
EC2 - good
EMR - good
Glue - Added above
S3 - good
SageMaker - good


No changes required:

Operators:
CloudFormationCreateStackOperator
CloudFormationDeleteStackOperator
GlacierCreateJobOperator
SnsPublishOperator
StepFunctionGetExecutionOutputOperator
StepFunctionStartExecutionOperator
AthenaSensor
CloudFormationCreateStackSensor
CloudFormationDeleteStackSensor
DmsTaskBaseSensor
DmsTaskCompletedSensor

Sensors:
GlacierJobOperationSensor
StepFunctionExecutionSensor

Hooks:
ElastiCacheReplicationGroupHook
GlacierHook
RedshiftHook
S3Hook
SageMakerHook
SecretsManagerHook
StepFunctionHook

Related issues

#20139

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. ferruzzi commented on Dec 14, 2021

    @ferruzzi
    ContributorAuthor

    @eladkal Should the Hooks be part of this campaign as well, or is that scope-creep getting out of hand?

  2. eladkal commented on Dec 14, 2021

    @eladkal
    Contributor

    We should do both
    #20160 already handle Emr

    This task shouldn't take long. Lets try to finish all in the next few days so all new paths/classes will be avaliable in the next peovider release.

  3. eladkal commented on Dec 14, 2021

    @eladkal
    Contributor

    @KennyRich would you like to pick some?

  4. ferruzzi commented on Dec 14, 2021

    @ferruzzi
    ContributorAuthor

    We should do both

    Sounds good. I'll add the hooks to the Action Items.

    I rebased 'main' this morning and it was failing pre-commits. I just re-rebased and running them again, but I think I have Athena operators done, I'll get a PR for those up once local CI passes.

    [EDIT = main is still failing pre-commits as of 12:45 PST]

  5. ferruzzi commented on Dec 14, 2021

    @ferruzzi
    ContributorAuthor

    hooks/logs.py calls the hook AwsLogsHook and... I think we should keep that one. "LogsHook" is just too generic IMHO.

  6. KennyRich commented on Dec 14, 2021

    @KennyRich
    Contributor

    @KennyRich would you like to pick some?

    Yes sure!!!

  7. dstandish commented on Dec 14, 2021

    @dstandish
    Contributor

    @eladkal i thought that RedshiftSqlOperator was not correct and that RedshiftSQLOperator .... i remember discussion about this at some point in the past

  8. eladkal commented on Dec 14, 2021

    @eladkal
    Contributor

    @eladkal i thought that RedshiftSqlOperator was not correct and that RedshiftSQLOperator .... i remember discussion about this at some point in the past

    I think so too. I didnt review the whole list yet.
    We always must look for consistency (other operators, other providers etc...) In case of sql its easy as we have planty.

  9. ferruzzi commented on Dec 14, 2021

    @ferruzzi
    ContributorAuthor

    My mistake! I have updated the OP

  10. eladkal commented on Dec 15, 2021

    @eladkal
    Contributor

    @KennyRich would you like to pick some?

    Yes sure!!!

    Please let us know which so we can assign.

  11. KennyRich commented on Dec 15, 2021

    @KennyRich
    Contributor

    @KennyRich would you like to pick some?

    Yes sure!!!

    Please let us know which so we can assign.

    I'll handle Sqs

  12. eladkal commented on Dec 16, 2021

    @eladkal
    Contributor

    @bhavaniravi would you like to take the emr hook?

  13. bhavaniravi commented on Dec 16, 2021

    @bhavaniravi
    Contributor

    Yup will do.

  14. ferruzzi commented on Dec 16, 2021

    @ferruzzi
    ContributorAuthor

    EKS is a big one, I'll get started on that

  15. ferruzzi commented on Dec 17, 2021

    @ferruzzi
    ContributorAuthor

    Question for @eladkal - The module for the Lambda hook is named hooks/lambda_function.py. The class is AwsLambdaHook (being renamed to LambdaHook). Do we want to rename the module to just lambda.py while we're at it? Or maybe make the hook LambdaFunctionHook so it matches the module name? In my experience, "nobody" calls it an AWS Lambda Function in conversation, I always hear it referred to as AWS Lambda, so I don't think that would be a confusing change? Counterpoint: the Dynamo module is still called dynamodb.py and I don't feel like that one should be changed, so I'm not sure. Maybe just leave the file name alone? Thoughts?

  16. eladkal commented on Dec 20, 2021

    @eladkal
    Contributor

    @KennyRich do you need help?

  17. KennyRich commented on Dec 20, 2021

    @KennyRich
    Contributor

    @KennyRich do you need help?

    Please you can help go through my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions