-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Standardize naming of AWS Sqs #20418
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
Conversation
eladkal
left a comment
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.
Did partial review as some of my comments apply to more than 1 file.
Let me know if something isn't clear enough
CHANGELOG.txt
Outdated
| - [AIRFLOW-XXX] Ignore Python files under node_modules in docs (#5063) | ||
| - [AIRFLOW-XXX] Build a universal wheel with LICNESE files (#5052) | ||
| - [AIRFLOW-XXX] Fix docstrings of SQSHook (#5099) | ||
| - [AIRFLOW-XXX] Fix docstrings of SqsHook (#5099) |
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.
We don't alter past records in change log. this entry was valid to the day it was created.
Please revert this change.
UPDATING.md
Outdated
| | airflow.contrib.hooks.aws_athena_hook.AWSAthenaHook | airflow.providers.amazon.aws.hooks.athena.AWSAthenaHook | | ||
| | airflow.contrib.hooks.aws_lambda_hook.AwsLambdaHook | airflow.providers.amazon.aws.hooks.lambda_function.AwsLambdaHook | | ||
| | airflow.contrib.hooks.aws_sqs_hook.SQSHook | airflow.providers.amazon.aws.hooks.sqs.SQSHook | | ||
| | airflow.contrib.hooks.aws_sqs_hook.SqsHook | airflow.providers.amazon.aws.hooks.sqs.SqsHook | |
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.
There is no SqsHook in contrib.
We also can't suggest here airflow.contrib.hooks.aws_sqs_hook.SQSHook -> airflow.providers.amazon.aws.hooks.sqs.SqsHook because this table is for upgrading from 1.10 to 2.0 and in 2.0 only backport amazon provider is compatible so the changes we do in this PR are not relevant for it.
Long story short - please undo the changes you made for this file :)
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 still see changes on this file
@KennyRich did you undo all changes to this file?
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.
Yes
| import warnings | ||
|
|
||
| from airflow.providers.amazon.aws.hooks.sqs import SQSHook # noqa | ||
| from airflow.providers.amazon.aws.hooks.sqs import SqsHook # noqa |
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.
This is not backward compatible. We are changing the class name.
So with the current code when user try to import SQSHook it won't work
Check reference of SESHook https://github.com/apache/airflow/pull/20367/files
It should
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.
Thanks. I understand that some of the changes aren't backward compatible but, this file has a deprecation warning here already. Do I just revert the changes here and create a deprecation warning for the SQSHook and make it backward compatible like this
class SQSHook(SqsHook):
"""
This hook is deprecated.
Please use :class:`airflow.providers.amazon.aws.hooks.sqs.SqsHook`.
"""
def __init__(self, *args, **kwargs):
warnings.warn(
"This hook is deprecated. " "Please use :class:`airflow.providers.amazon.aws.hooks.sqs.SqsHook`.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)
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.
yes. The current implementation support deprecation where the class name was not change so it just add an import of where to find it but now - the class name did change so we must address it. Yes the class you wrote should do the trick.
| import warnings | ||
|
|
||
| from airflow.providers.amazon.aws.operators.sqs import SQSPublishOperator # noqa | ||
| from airflow.providers.amazon.aws.operators.sqs import SqsPublishOperator # noqa |
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.
same
| import warnings | ||
|
|
||
| from airflow.providers.amazon.aws.sensors.sqs import SQSSensor # noqa | ||
| from airflow.providers.amazon.aws.sensors.sqs import SqsSensor # noqa |
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.
same
| * ``Fix AthenaSensor calling AthenaHook incorrectly (#15427)`` | ||
| * ``Add links to new modules for deprecated modules (#15316)`` | ||
| * ``Fixes doc for SQSSensor (#15323)`` | ||
| * ``Fixes doc for SqsSensor (#15323)`` |
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.
same comment as previous changelog.
Please undo
|
|
||
|
|
||
| class SQSHook(AwsBaseHook): | ||
| class SqsHook(AwsBaseHook): |
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.
This is also not backward compatible. We want both SQSHook and SqsHook to work.
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.
This has been handled please check and let me know what you think.
|
|
||
|
|
||
| .. _howto/operator:SQSPublishOperator: | ||
| .. _howto/operator:operator:SQSPublishOperator: |
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.
Is this right ? Shouldn't it be?
| .. _howto/operator:operator:SQSPublishOperator: | |
| .. _howto/operator:SqsPublishOperator: |
|
|
||
| Use the | ||
| :class:`~airflow.providers.amazon.aws.operators.sqs.SQSPublishOperator` | ||
| :class:`~airflow.providers.amazon.aws.operators.sqs.operator:SQSPublishOperator` |
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.
same question
|
|
||
| from airflow.providers.amazon.aws.hooks.s3 import S3Hook | ||
| from airflow.providers.amazon.aws.operators.s3 import S3CreateBucketOperator, S3DeleteBucketOperator | ||
| from airflow.providers.amazon.aws.operators.s3_bucket import S3CreateBucketOperator, S3DeleteBucketOperator |
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.
Why are you modifying s3 files?
I think you have several unrelated changes of s3 in this PR.
|
@KennyRich do you need help to finish this PR? |
Yes please, I have been unwell for a couple of days now |
|
Closing in favor of #20732 |
Part of #20296
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.