-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Fix HDFSHook HAClient is invalid #30164
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
Conversation
|
Another code implementation: |
|
I think we need a unit test covering it to prevent regressions. It's suspicious not see tests modified/added/fixed with such a change |
I modify a bad unit test, @potiuk please take a look, thanks |
| def test_get_ha_client(self, mock_get_connections): | ||
| conn_1 = Connection(conn_id="hdfs_default", conn_type="hdfs", host="localhost", port=8020) | ||
| conn_2 = Connection(conn_id="hdfs_default", conn_type="hdfs", host="localhost2", port=8020) | ||
| mock_get_connections.return_value = [conn_1, conn_2] |
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.
Connection model conn_id field is unique
|
Needs static checks fixing though (you can install/run pre-commit to fix those). |
|
Awesome work, congrats on your first merged pull request! |
BaseHook.get_connections is deprecated, only return one connection
snakebite HAClient need more than one connection
HAClient