You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be a way to configure the samba provider to use backward slashes instead of forward slashes for joining the path.
How to reproduce
You will need a Windows computer with a network share which can be accessed using a username and password.
E.g. computer name "windowsSharer", share "windowsShare", user "WindowsUser", ...
The connection can then be configured in airflow.
Create a simple dag where the SambaHook is created and the listdir function is called, e.g.: hook = SambaHook(samba_conn_id=samba_conn_id) files_and_dirs = hook.listdir("windowsDirectory") print(f"{files_and_dirs}")
The listdir function will fail.
However, using smbclient directly like this: from smbclient import listdir, mkdir, register_session, rmdir, scandir from smbclient.path import isdir pathBackSlash = r"\\windowsSharer\windowsShare\windowsDirectory" for filename in listdir(pathBackSlash, username=r"WindowsUser@Domain", password="secret"): print(f"{filename}")
Will work, and when you change to forward slashes you get the same "STATUS_INVALID_PARAMETER" message like with the airflow provider.
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
I am interested in contributing to this project as part of Google Summer of Code 2025. Since this is my first time participating in GSoC, I would appreciate some guidance on how to proceed.
Would it be appropriate for me to raise a PR for this issue? If so, are there any specific guidelines or prerequisites I should follow before submitting my contribution?
Apache Airflow version
2.10.5
If "Other Airflow 2 version" selected, which one?
No response
What happened?
When I connect to a Windows share using the samba provider I am receiving a STATUS_INVALID_PARAMETER error when I try to use the "listdir" function.
This is due to the fact that in https://github.com/apache/airflow/blob/main/providers/samba/src/airflow/providers/samba/hooks/samba.py line 88 the path is created using // at the beginning and / as a separator.
When using the smbclient python package directly and typing backward slashes for joining a path, it works without any errors.
What you think should happen instead?
There should be a way to configure the samba provider to use backward slashes instead of forward slashes for joining the path.
How to reproduce
You will need a Windows computer with a network share which can be accessed using a username and password.
E.g. computer name "windowsSharer", share "windowsShare", user "WindowsUser", ...
The connection can then be configured in airflow.
Create a simple dag where the SambaHook is created and the listdir function is called, e.g.:
hook = SambaHook(samba_conn_id=samba_conn_id) files_and_dirs = hook.listdir("windowsDirectory") print(f"{files_and_dirs}")
The listdir function will fail.
However, using smbclient directly like this:
from smbclient import listdir, mkdir, register_session, rmdir, scandir
from smbclient.path import isdir
pathBackSlash = r"\\windowsSharer\windowsShare\windowsDirectory"
for filename in listdir(pathBackSlash, username=r"WindowsUser@Domain", password="secret"):
print(f"{filename}")
Will work, and when you change to forward slashes you get the same "STATUS_INVALID_PARAMETER" message like with the airflow provider.
Operating System
Ubuntu 24.04.2 LTS (in wsl)
Versions of Apache Airflow Providers
apache-airflow-providers-samba==4.9.1
Deployment
Virtualenv installation
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: