-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
[AIRFLOW-3701] Google Cloud Vision Product Search operators #4665
[AIRFLOW-3701] Google Cloud Vision Product Search operators #4665
Conversation
452f302
to
7128c64
Compare
CC @kaxil, would be great if you could take a look :) |
Codecov Report
@@ Coverage Diff @@
## master #4665 +/- ##
==========================================
+ Coverage 74.61% 74.68% +0.06%
==========================================
Files 431 434 +3
Lines 28044 28359 +315
==========================================
+ Hits 20925 21179 +254
- Misses 7119 7180 +61
Continue to review full report at Codecov.
|
not to against this pr, but is it possible to move this pr(or other similar pr) to some other plugin repos (e.g. https://github.com/airflow-plugins) ? Airflow release only happens once every few months. If you want to reiterate your code fast and get a new release for your operator bug fix, it would be better put on a separate repo instead Airflow? Besides not sure of other committers, I personally have no experience on this kinda operators and it would be hard to review as well. I would like to hear other committers idea on this as well: @ashb @kaxil @bolkedebruin |
@feng-tao I've been thinking about it for a long time. Unfortunately, this is not a simple and easy matter Short story: Long story: I found an old PR, which introduced support for plugins installed via pip. I fell in love with this PR, so i tried to revive the old PR. For this purpose, i wrote message to @kaxil on Slack for support. He wrote a comment on December 3 in the reaction. In the meantime, an alternative PRs has appeared. #4412. It was accepted quickly The discussion about modularity on the dev list has started. During these discussion, it turned out that splitting Airflow into plugins is not such a simple matter. If you think that it is worth to start changes on this matter, I invite you to the discussion on the mailing list. I have the hope that my explanations will be helpful to you. Thank you very much for your suggestion. Disclaimer: This is just my personal statement. I described my observations that are public. Other people in my company may think differently. I believe that the presented story allows us to better understand the context. |
If you are talking about that AIP, I am surely +1 on moving those community built hooks/operators etc into other plugins/packages, but just haven't had time to comment on various threads. But I don't agree if the Airflow committers should be the only maintainers to maintain those packages. I know it is a not very simple solution(which one to move out, which one to stay, who should maintain, how to handle dependency etc). IMO, It is hard from a user standpoint to decide which one to use, which one is actively maintained and whether it is released in a given Airflow version. In fact, we(Lyft) just rely on the plugin system internally to build various operator/hook which makes our development iteration much faster. |
7128c64
to
84671e8
Compare
Hi @feng-tao, I think the change you're proposing is a major undertaking and looking through previous discussions on the devlist I see that no consensus has been reached so far as to the exact solution. I think the idea is worth considering but given that we've been contributing GCP operators this way for half a year now I'd suggest that this PR follow the same pattern. @kaxil, maybe you could take a look at the PR, given you're previous involvement in PRs with other GCP operators? Many thanks in advance :) |
-1000 to operators in plugins. They are just python modules. I'm not against them being separate python modules, just 100% against making them plugins, there is no need.
and then
Nothing plugin-y needed. |
84671e8
to
d0cccc3
Compare
@feng-tao Your idea of frequent releases for plugins can work only if the extended functionality is unrelated to Airflow hooks. This is a big if. |
a030300
to
43ab1b2
Compare
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.
Although I agree with @feng-tao 's argument, as we have not yet decided an approach on splitting out contrib packages into separate repos, let's merge this one. Once an approach has been finalised and work on it is started we can migrate it into its own repo.
@sprzedwojski A minor comment - Can you please resolve it.
PRODUCT_NAME_TEMPLATE = 'projects/{}/locations/{}/products/{}' | ||
|
||
|
||
# noinspection PyAbstractClass |
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 should remove any noinspection
stuff. Let's aim to fix this on BaseOperator level.
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 @kaxil, I removed it. Also I've applied small refactoring according to @mik-laj's suggestion (PolideaInternal#51 (comment)) and renamed the get_client()
method in hook to get_conn()
to be consistent with other hooks.
43ab1b2
to
357eb1f
Compare
""" | ||
import os | ||
|
||
# [START howto_operator_vision_retry_import] |
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 do we have this?? We don't use this in docs.
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.
Actually it is used in the docs (example: https://github.com/apache/airflow/pull/4665/files#diff-40e5e831dc73c82a2aba583e5f89f8a8R2035, operator.rst
file, line 2035).
We wanted to include imports in the "How-to" documentation to allow the user to copy-paste the code from there and use it right away, without the need to refer to the example DAG's source code.
# [START howto_operator_vision_retry_import] | ||
from google.api_core.retry import Retry | ||
# [END howto_operator_vision_retry_import] | ||
# [START howto_operator_vision_productset_import] |
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
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 as above: #4665 (comment)
357eb1f
to
a3c0295
Compare
Added minor refactoring changes, mostly to |
1828879
to
32bb0e6
Compare
Added a minor change in |
c937c97
to
2cb869e
Compare
Hi @kaxil, would you be able to find a moment so we could merge this one? |
2cb869e
to
fa11006
Compare
Thanks @sprzedwojski . I am on annual leave, hence have little to no access to the laptop and internet |
Thanks @kaxil, I appreciate you taking the time while on vacations. Enjoy your holidays! |
Make sure you have checked all steps below.
Jira
Description
Implemented the following Cloud Vision Product Search operators:
Tests
test_gcp_vision_hook.py
test_gcp_vision_operator.py
Commits
Documentation
Code Quality
flake8