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

Add Qdrant Provider #36805

Merged
merged 37 commits into from
Feb 8, 2024
Merged

Add Qdrant Provider #36805

merged 37 commits into from
Feb 8, 2024

Conversation

Anush008
Copy link
Contributor

@Anush008 Anush008 commented Jan 16, 2024

This PR intends to add Qdrant as a supported provider by implementing an operator and hook that enables interfacing with Qdrant within Airflow DAGs.

Qdrant is an open-source, Apache-licensed, vector search engine and database.

[Discussion] Add Qdrant as a supported provider

[LAZY CONSENSUS] Adding an Airflow provider for Qdrant

Copy link

boring-cyborg bot commented Jan 16, 2024

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

I think that some of the hook tests are not needed since there is no wrapper for the client methods in the hook, you call them from the client and you check if they are called. Same for the hook integration tests. I don't have a strong opinion on this, let's wait for the other reviews.

airflow/providers/qdrant/hooks/qdrant.py Outdated Show resolved Hide resolved
@Anush008
Copy link
Contributor Author

Anush008 commented Jan 20, 2024

I think that some of the hook tests are not needed since there is no wrapper for the client methods in the hook, you call them from the client and you check if they are called. Same for the hook integration tests. I don't have a strong opinion on this, let's wait for the other reviews.

Right. There were some wrapper methods before this commit. But then they seemed redundant as the caller can very well get the client through get_conn() or @property conn and have access to all the methods. So I updated the mock hook tests accordingly.

Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
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

airflow/providers/qdrant/CHANGELOG.rst Outdated Show resolved Hide resolved
airflow/providers/qdrant/hooks/qdrant.py Show resolved Hide resolved
@potiuk
Copy link
Member

potiuk commented Feb 2, 2024

FYI: @Anush008 :

You will have to make your provider compatible with Airflow 2.7.0+ the compatibility checks detected, that your provider requires Pydantic 2 by, which is not supported in Airflow 2.6.*. You will need to specify apache-airflow>=2.6.0 in provider.yaml and exclude your provider for 2.6 checks in BASE_PROVIDER_COMPATIBILITY_CHECKS:

https://github.com/apache/airflow/blob/main/dev/breeze/src/airflow_breeze/global_constants.py#L467

@Anush008
Copy link
Contributor Author

Anush008 commented Feb 2, 2024

Hey.

the compatibility checks detected, that your provider requires Pydantic 2 by, which is not supported in Airflow 2.6.*.

qdrant_client uses Pydantic v1. The failing check compat seems to arise from Pydantic V2 use by a different provider.

@potiuk
Copy link
Member

potiuk commented Feb 2, 2024

It's problem with Airflow - 2.6 has problem with Pydantic 2 (that's why you need to limit qdran to >= 2.7.0 because Airflow 2.6.* only supports Pydantic 1). That's why you cannot install qdrant on it. As of 2.7 Airflow supports both Pydantic 1/2 and in 2.8 only Pydantic >=2

@potiuk
Copy link
Member

potiuk commented Feb 2, 2024

It's problem with Airflow - 2.6 has problem with Pydantic 1(that's why you need to limit it. That's why you cannot install qdrant on it. As of 2.7 airflwo supports both an d in 2.8. only >2

Or so it looked like(I now am using a phone)

@potiuk
Copy link
Member

potiuk commented Feb 8, 2024

FINALLY GREEN !!!.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

LGTM

@potiuk potiuk merged commit bc50c58 into apache:main Feb 8, 2024
82 checks passed
Copy link

boring-cyborg bot commented Feb 8, 2024

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@potiuk
Copy link
Member

potiuk commented Feb 8, 2024

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

@Anush008
Copy link
Contributor Author

Anush008 commented Feb 8, 2024

Thanks @potiuk, @eladkal, @josh-fell, @hussein-awala for supporting this 🙏🙏.

Do let me know if there's anything else needed.

@potiuk
Copy link
Member

potiuk commented Feb 8, 2024

Usually the real work starts after it gets in the hands of the users :)

@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) kind:documentation provider:qdrant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants