-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 support for extra parameters to samba client #16115
Conversation
samba = SambaClient( | ||
server=self.conn.host, | ||
share=self.conn.schema, | ||
username=self.conn.login, | ||
ip=self.conn.host, | ||
password=self.conn.password, | ||
**self.conn.extra_dejson, |
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.
Is the list of fields exhaustive? I feel we should do some sanitising instead of passing the whole JSON object directly in.
Also :param
is for function arguments and should not be used for extra
keys. These descriptions should live somewhere else.
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.
@uranusjr fixed in 0c8cca7 – the list is inexhaustive (mentioned now) and I have reformatted as definition list.
The :param
stuff was token from the Oracle hook, but I guess that is a bad example :-)
By the way, I have since realized that the underlying Python library that supports SambaHook
is basically abandonware and not particularly useful – it breaks quite a few expectations if you look at the actual smbclient
functionality.
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.
By the way, I have since realized that the underlying Python library that supports
SambaHook
is basically abandonware and not particularly useful
Thanks for taising this. It would be worthwhile to open an issue for this to migrate to another library, I think. I don’t have much experience dealing with SMB with Python, but pysmb
seems to be a popular choice.
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.
There is an open issue: #14054
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.
@uranusjr so I think we can perhaps go ahead and consider merging this request and then I'll submit another request to migrate to pysmb
.
I have already done some testing and it seems very well suited.
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.
Yup LGTM. Could you close-reopen the PR to trigger CI?
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.
@uranusjr done
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.
@malthe
Can you please rebase to latest main (former master branch)?
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 done!
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 looks about ready now, checks have run.
0c8cca7
to
b41b0be
Compare
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.
LGTM
will merge when CI is green
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
@malthe can you fix the static test? |
@eladkal fixed – I don't really understand this automated build, but the static test seems to be skipped now. |
0f6217a
to
b1b0297
Compare
@@ -128,7 +128,7 @@ def test_wait_for_job_cancelled(self, mock_get_job): | |||
|
|||
@requests_mock.mock() | |||
def test_connection_success(self, m): | |||
m.get(self.health_endpoint, status_code=200,) | |||
m.get(self.health_endpoint, status_code=200) |
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.
This change is not related :)
We also had a broken CI so another rebase so fix the failing tests
eb193b8
to
88c2079
Compare
@eladkal should be ready now. |
88c2079
to
ea4e6aa
Compare
This adds the option to use the extra field for adding additional parameters to the
SambaClient
constructor such asworkgroup
using JSON-formatting.Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.