-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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 druid ingestion connection test #33796
Add druid ingestion connection test #33796
Conversation
I think better approach woudl be to keep one of the connections (DBApi ?) as "druid". It will at least make existing DBApi connections work. |
Also - this one woll need a changelog entry describing what changed and how users should modify their connections |
@potiuk |
I see. Ok then it should be a breaking change - but we let release manager decide on that - entry in changeloge should not contain the version (see suggestion). |
3.5.0 -> 4.0.0
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.
Left some comments.
We need also to have connections.rst
in druid provider.
See example in other provider:
https://github.com/apache/airflow/blob/main/docs/apache-airflow-providers-apache-hdfs/connections.rst
Related to #28790
.. note:: | ||
The connection type of Druid has been separated into two(druid_broker, druid_ingest) |
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.
Please elaborate on this one. We should explain to users how to mitigate the issue (leave instructions how to migrate to this new version)
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.
@eladkal
I'm not an English speaker, so I'm not sure if the following mention is accurate. Please review this
The connection type of Druid has been separated into two(Druid Broker, Druid Ingest). Please perform one of the two methods listed below.
1. update druid connect type to (Druid Broker, Druid Ingest) on UI screen (Admin/Connections)
2. run command airflow db migrate
but in second case, airflow db migrate doesn't support update connect type so we need implement this.
my suggestion is write first option only, and add an implementation to check the version of the Druid provider in the db migrate process. how about do this in other issue
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.
Nope, we don't have connection migrations, and with current release model (that doesn't mean it is bad) I don't think it even possible to implement it. All migration happen only on upgrade Airflow Core, not Providers.
Just some examples of the past breaking changes and their descriptions:
-
Remove AWS S3 Connection (spoiler alert, it does impact some users)
https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/changelog.html#id66 -
Removed deprecated fields in Slack Provider (still wait when users starts complain)
https://airflow.apache.org/docs/apache-airflow-providers-slack/stable/changelog.html#breaking-changes -
Deprecated parameter removed from Google Provider
https://airflow.apache.org/docs/apache-airflow-providers-google/stable/changelog.html#breaking-changes
The main point of this breaking changes. When user open issue/discussion in Github or write in slack it much easier to send them link to Breaking Changes, rather then try to figure out how to solve their issue.
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.
@eladkal @Taragolis
Taragolis thanks for adding example link
in this pr the only concern point is changing connection type. So, I think this mention is enough.
In this version of provider Apache Druid Connection(conn_type="druid") has been separated into two(Druid Broker, Druid Ingest)
Update connect type(conn_type = "druid") to druid broker, druid ingest
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.
The goal of the note is to explain what actions needed to be done in order to migrate.
The note you listed says the conn is split in two so:
- How do I choose which one? (Or/And what is the motivation to the split)
- If I want to have my code work exactly as it is before what steps I need to do?
These are the two questions the notes must answer
It's almost ready :) |
host = conn.host | ||
port = conn.port | ||
# ref : https://druid.apache.org/docs/latest/operations/api-reference/#tasks | ||
response = requests.get(f"http://{host}:{port}/druid/indexer/v1/tasks") |
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.
One of the main reasons for connection and test_connection method is storing the credentials securely and test them via this method, so IMHO this method should test if the credentials are valid or not. You can try something like:
response = requests.get(f"http://{host}:{port}/druid/indexer/v1/tasks") | |
response = requests.get( | |
f"http://{host}:{port}/druid/indexer/v1/tasks", | |
auth=self.get_auth(), | |
) |
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.
@hussein-awala
The Druid Broker Hook overrides the DbApiHook, but the test connection is not implemented to use authentication information
https://github.com/apache/airflow/blob/main/airflow/providers/common/sql/hooks/sql.py#L550
So, I think adding authentication information to the Druid hook (broker, ingest) is handled in another issue
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
expose druid connection and implement test
closes: #33795