Skip to content

Conversation

@p-eye
Copy link
Contributor

@p-eye p-eye commented Feb 17, 2025

Background:

The PinotDbApiHook and PinotAdminHook were previously not handling authentication properly when connecting to a secured Pinot cluster. In scenarios where authentication was required, the hooks would fail to pass login and password details, leading to connection and query failures.

Changes:

  1. PinotDbApiHook:

    • Enhanced the PinotDbApiHook to support authentication for both connection and query execution.
    • Added handling for login and password fields from the connection parameters to properly construct the connection URI and ensure authentication when connecting to the Pinot cluster.
  2. PinotAdminHook:

    • Updated the PinotAdminHook to handle authentication when running Pinot Admin CLI commands.
    • The CLI command was modified to include -user and -password flags, using the credentials from the connection object.
  3. Test Cases:

    • Added tests for both PinotDbApiHook and PinotAdminHook to verify the authentication logic:
      • For PinotDbApiHook, tests ensure that login and password are correctly used to generate the connection URI.
      • For PinotAdminHook, a test was added to verify that authentication details are passed to the CLI when running the add_schema command, for example.

Impact:

  • Authentication handling for both PinotDbApiHook and PinotAdminHook has been improved, ensuring that the hooks can now properly authenticate with Pinot clusters requiring login and password.

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg
Copy link

boring-cyborg bot commented Feb 17, 2025

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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.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

@p-eye p-eye changed the title Feature/add user pwd to pinotconn Feat: Add username, password to Pinot Connection Feb 17, 2025
@p-eye p-eye requested a review from potiuk February 19, 2025 13:42
@p-eye p-eye marked this pull request as draft February 19, 2025 13:55
@p-eye p-eye force-pushed the feature/add-user-pwd-to-pinotconn branch from a140da0 to 1f0f9ab Compare February 19, 2025 14:47
@p-eye p-eye marked this pull request as ready for review February 19, 2025 14:47
@p-eye
Copy link
Contributor Author

p-eye commented Feb 20, 2025

it passed the pre-commit and breeze test.
i'd appreciate your review. thanks.

@potiuk
Copy link
Member

potiuk commented Feb 24, 2025

regular tests fail now.

@p-eye
Copy link
Contributor Author

p-eye commented Mar 8, 2025

regular tests fail now.

  • I fixed the name of test parameters to adhere to Airflow Connection naming.
  • I enhanced the code to treat login and password if they are either None or empty strings.

@p-eye p-eye marked this pull request as ready for review March 8, 2025 07:48
@jscheffl jscheffl merged commit b3bccab into apache:main Mar 8, 2025
60 of 81 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Mar 8, 2025

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

nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Apr 4, 2025
* feat: add username, password to Pinot Connection

* fix: rename params conn.user to conn.login to align with Airflow Connection

* fix: don't add login/password to PinotCLI if None or empty string (Airflow UI connection behavior)
test: set login/password as empty string not to return mock
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.

3 participants