-
Notifications
You must be signed in to change notification settings - Fork 16.4k
TestConnectionOperator #47082
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
TestConnectionOperator #47082
Conversation
Why not just use the operator they actually want to use? I am not convinced about this feature |
|
@eladkal my thoughts:
One change in this from the If (though my vote would still be "why expect new users to know this random snippet, or find it in a doc or blog post?" Something off the shelf feels more friendly and useful, especially given how connections are one of the most core pieces of Airflow and are a pretty rough-edged UX at the moment) |
|
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. |
|
This is essentially @task
def test_connection(conn_id):
ok, status = BaseHook.get_hook(conn_id=conn_id).test_connection()
if ok:
return status
raise RuntimeError(status)I feel what we really need is to document this pattern better, maybe provide the snippet as a recipe. It seems like an overkill for me adding a dedicated operator class. |
Given the default
Test Connectionmethod in the Airflow UI being disabled, I find myself frequently writing similar code to this, while implementing a "Canary DAG" patternsAdditionally - as an operator, there is the added benefit of a standard method of testing connections that may be defined via other mechanisms, and having a clear procedure that can be easily recommended to new users to help debug connection woes and test things like networking configurations.
Remaining todo: