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

Standardize AWS Batch naming #20369

Merged
merged 5 commits into from
Jan 6, 2022
Merged

Standardize AWS Batch naming #20369

merged 5 commits into from
Jan 6, 2022

Conversation

ferruzzi
Copy link
Contributor

Part of #20296

In addition:

  • Fixed capitalization in some comments from batch to Batch where applicable.
  • Changed execute(None) and poke(None) to execute({}) and poke({}) because my IDE was throwing a type error (expected a dict, got NoneType).

^ 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.

@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Dec 17, 2021
Comment on lines 43 to 46
"""
A structured Protocol for ``boto3.client('batch') -> botocore.client.Batch``.
This is used for type hints on :py:meth:`.AwsBatchClient.client`; it covers
This is used for type hints on :py:meth:`.BatchClient.client`; it covers
only the subset of client methods required.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure if this one should have been left along. Please double check me here.

Comment on lines +543 to +556
class AwsBatchProtocol(BatchProtocol, Protocol):
"""
This class is deprecated.
Please use :class:`airflow.providers.amazon.aws.hooks.batch.BatchProtocol`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"This class is deprecated. "
"Please use :class:`airflow.providers.amazon.aws.hooks.batch.BatchProtocol`.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see this discussion before approving: #20332 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not needed any more...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, based on the other one now working I'll be doing this next. I'm not sure why that was giving me an error before, but it seems clear now. /shrug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were right. We need the protocol.
see a fix we had to deploy #20669

@ferruzzi ferruzzi closed this Jan 4, 2022
@ferruzzi ferruzzi reopened this Jan 4, 2022
@ferruzzi ferruzzi closed this Jan 5, 2022
@ferruzzi ferruzzi reopened this Jan 5, 2022
@ferruzzi
Copy link
Contributor Author

ferruzzi commented Jan 6, 2022

Now we are failing isort because of #20369 (comment) and removing the Protocol inheritance in 05abb3b causes the error we saw before about "only a Protocol can import a Protocol"

I'm not sure what to do here.

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.

The test failures related to files that that are missing in the PR:

https://github.com/apache/airflow/blob/main/airflow/contrib/operators/awsbatch_operator.py

"airflow.providers.amazon.aws.operators.batch.AwsBatchOperator",
"airflow.contrib.operators.awsbatch_operator.AWSBatchOperator",

You need to make changes on one of them or both depends on the needed fix. I think it's identical case to the Ecs so probably best to look at how the code looks there on Main barch and see if applying same fix here will solve the issue.

airflow/providers/amazon/aws/operators/batch.py Outdated Show resolved Hide resolved
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.

LGTM
will merge when CI is green

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Jan 6, 2022
@eladkal eladkal removed the full tests needed We need to run full set of tests for this PR to merge label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:amazon AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants