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

Feature: Add invoke lambda function operator #21686

Merged
merged 7 commits into from
Mar 1, 2022
Merged

Feature: Add invoke lambda function operator #21686

merged 7 commits into from
Mar 1, 2022

Conversation

schirag1993
Copy link
Contributor

@schirag1993 schirag1993 commented Feb 19, 2022

related: #21009

This change is to implement AWS Lambda function invoke operator for the AWS provider package.


^ 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 AWS/Amazon - related issues labels Feb 19, 2022
@schirag1993 schirag1993 marked this pull request as ready for review February 19, 2022 17:33
@schirag1993 schirag1993 changed the title add invoke lambda function operator Feature: Add invoke lambda function operator Feb 19, 2022
Copy link
Contributor

@malthe malthe left a comment

Choose a reason for hiding this comment

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

I have raised a couple of code-level issues for your consideration.

airflow/providers/amazon/aws/hooks/lambda_function.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/lambda_function.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/operators/aws_lambda.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/operators/aws_lambda.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/operators/aws_lambda.py Outdated Show resolved Hide resolved
Copy link
Contributor

@edwardwang888 edwardwang888 left a comment

Choose a reason for hiding this comment

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

Added some minor comments.

airflow/providers/amazon/aws/operators/aws_lambda.py Outdated Show resolved Hide resolved
tests/providers/amazon/aws/operators/test_lambda.py Outdated Show resolved Hide resolved
tests/providers/amazon/aws/operators/test_lambda.py Outdated Show resolved Hide resolved
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

Note: This needs a major version bump in the Amazon provider.

@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Feb 22, 2022
@schirag1993
Copy link
Contributor Author

Looks like I missed adding documentation and an example DAG. I've updated the PR with the same.

Note: This needs a major version bump in the Amazon provider.

A few QQs: What does it mean if a major version bump is required? Is there anything required on my part? What usually qualifies for a major version bump for provider packages?

@uranusjr
Copy link
Member

It means we need to be careful when including this change in a release on PyPI. Nothing you need to do here.

@ferruzzi
Copy link
Contributor

Sorry, I submitted those as single comments. Wish I could retroactively roll them into a review to reduce clutter.

@schirag1993
Copy link
Contributor Author

Sorry, I submitted those as single comments. Wish I could retroactively roll them into a review to reduce clutter.

It's no trouble at all, thank you for the review @ferruzzi. Allow me to work on these changes. It appears some tests are failing as well. Will work on the same.

@potiuk
Copy link
Member

potiuk commented Feb 26, 2022

Tests and docs are failing :(

@schirag1993
Copy link
Contributor Author

Apologies for the trouble @potiuk. Working on the fixes today. Let me convert this into a draft.

@schirag1993 schirag1993 marked this pull request as draft February 27, 2022 07:10
@schirag1993 schirag1993 marked this pull request as ready for review February 27, 2022 08:06
@schirag1993
Copy link
Contributor Author

Apologies for the trouble @potiuk. Working on the fixes today. Let me convert this into a draft.

Fixes pushed! Hope I got it right this time.

@schirag1993
Copy link
Contributor Author

@malthe, @edwardwang888, @ferruzzi, @mik-laj, would y'all also be able to provide further feedback/approval on the PR please? I hope the changes have addressed all existing comments.

update operator and underlying hook code to explicitly specify invoke
and create function arguments
modify test cases to use static method for lambda invoke operator
remove redundant try-except block
update AWS lambda hook functions to enforce keyword only args
@potiuk potiuk merged commit 33edeb2 into apache:main Mar 1, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 1, 2022

Awesome work, congrats on your first merged pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers okay to merge It's ok to merge this PR as it does not require more tests provider:amazon-aws AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants