-
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
Move responsibility to run a command from WinRMOperator to WinRMHook #43646
Merged
eladkal
merged 19 commits into
apache:main
from
dabla:refactor/closable-winrm-hook-with-run-method
Nov 6, 2024
Merged
Move responsibility to run a command from WinRMOperator to WinRMHook #43646
eladkal
merged 19 commits into
apache:main
from
dabla:refactor/closable-winrm-hook-with-run-method
Nov 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…or to WinRMHook and also made WinRMHook closable
eladkal
approved these changes
Nov 6, 2024
Thx @eladkal :) |
ellisms
pushed a commit
to ellisms/airflow
that referenced
this pull request
Nov 13, 2024
…pache#43646) * refactor: Moved responsibility to run a command away from WinRmOperator to WinRMHook and also made WinRMHook closable * refactor: Reformatted exception message in WinRMOperator * refactor: command parameter of run method in WinRMHook must be specified * refactor: Changed return type of run method in WinRMHook * refactor: WinRMHook cannot be closable as it doesn't have the winrm_client instance * refactor: Reorganized imports in WinRMHook * refactor: Added unit tests for new run method in WinRMHook * refactor: Reorganized imports in TestWinRMHook --------- Co-authored-by: David Blain <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moved the responsibility to be able to run a command from the WinRMOperator to the WinRMHook, just like it's also the case with a lot of other operators like for example the SQL operators which delegate the responsibility to be able to run an SQL statement to the DbApiHook. The reason is simple, if you want to execute an SQL statement or in this case a command from within a PythonOperator, you cannot use the WinRMOperator, you have to use the WinRMHook, so it makes sense that the WinRMHook has the logic to execute the command, not the operator, as the operator is only a facilitator to allow you to run a command from within a DAG
^ 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.