Skip to content

Conversation

@KennyRich
Copy link
Contributor

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.

Copy link
Contributor

@eladkal eladkal left a 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)
Copy link
Contributor

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 |
Copy link
Contributor

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 :)

Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

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)

Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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)``
Copy link
Contributor

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):
Copy link
Contributor

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.

Copy link
Contributor Author

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:
Copy link
Contributor

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?

Suggested change
.. _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`
Copy link
Contributor

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
Copy link
Contributor

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.

@eladkal
Copy link
Contributor

eladkal commented Jan 4, 2022

@KennyRich do you need help to finish this PR?

@KennyRich
Copy link
Contributor Author

@KennyRich do you need help to finish this PR?

Yes please, I have been unwell for a couple of days now

@eladkal
Copy link
Contributor

eladkal commented Jan 6, 2022

Closing in favor of #20732

@eladkal eladkal closed this Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants