{"id":5850,"library":"apache-airflow-providers-samba","title":"Apache Airflow Samba Provider","description":"The `apache-airflow-providers-samba` library provides Apache Airflow operators and hooks for interacting with Samba (SMB/CIFS) file shares. It enables users to perform file operations like reading, writing, moving, and deleting files on Samba servers directly within Airflow DAGs. The current version is 4.12.5, and it follows a regular release cadence as part of the Apache Airflow provider ecosystem, with versioning independent of Airflow core but with specific minimum Airflow version requirements.","status":"active","version":"4.12.5","language":"en","source_language":"en","source_url":"https://github.com/apache/airflow/tree/main/airflow/providers/samba","tags":["airflow","provider","samba","smb","cifs","file-transfer","hook","operator"],"install":[{"cmd":"pip install apache-airflow-providers-samba","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core Airflow functionality; requires Airflow 2.11+ for provider version 4.12.x.","package":"apache-airflow","optional":false},{"reason":"Underlying Python client for SMB/CIFS protocol interactions.","package":"pysmbclient","optional":false}],"imports":[{"note":"The old `airflow.hooks.samba_hook` module is deprecated; use the provider-specific path.","wrong":"from airflow.hooks.samba_hook import SambaHook","symbol":"SambaHook","correct":"from airflow.providers.samba.hooks.samba import SambaHook"},{"symbol":"SambaOperator","correct":"from airflow.providers.samba.operators.samba import SambaOperator"}],"quickstart":{"code":"from __future__ import annotations\n\nimport pendulum\n\nfrom airflow.models.dag import DAG\nfrom airflow.providers.samba.operators.samba import SambaOperator\n\nwith DAG(\n    dag_id=\"samba_file_operations_example\",\n    start_date=pendulum.datetime(2023, 1, 1, tz=\"UTC\"),\n    catchup=False,\n    schedule=None,\n    tags=[\"samba\", \"file_transfer\"],\n) as dag:\n    # This task assumes an Airflow Connection named 'samba_default' is configured.\n    # Configure a connection in the Airflow UI:\n    # Conn Id: samba_default\n    # Conn Type: Samba\n    # Host: <Samba Server IP/Hostname>\n    # Login: <Samba Username>\n    # Password: <Samba Password>\n    # Schema: <Optional default share name, e.g., 'share'>\n    # Extra: {\"share_type\": \"posix\"} or {\"share_type\": \"windows\"}\n\n    move_file_task = SambaOperator(\n        task_id=\"move_samba_file\",\n        samba_conn_id=\"samba_default\",\n        source_path=\"/source/path/file.txt\",\n        destination_path=\"/destination/path/file.txt\",\n        operation=\"move\",  # Other supported operations: 'read', 'write', 'delete'\n    )\n","lang":"python","description":"This quickstart demonstrates how to use the `SambaOperator` to move a file on a Samba share. It requires an Airflow connection named `samba_default` to be configured with the Samba server details. The `operation` parameter can be 'move', 'read', 'write', or 'delete'."},"warnings":[{"fix":"Ensure your Airflow core installation meets or exceeds the minimum version specified in the provider's changelog or documentation for the installed provider version. For 4.12.x, upgrade Airflow to 2.11+.","message":"Provider versions have specific minimum Apache Airflow core version requirements. For example, `apache-airflow-providers-samba` version 4.12.x requires Airflow 2.11+ due to internal API changes like the removal of the `apply_default` decorator.","severity":"breaking","affected_versions":"4.0.0+"},{"fix":"Use the `share_type='windows'` parameter in your Samba connection's 'Extra' field (`{\"share_type\": \"windows\"}`) or explicitly use Windows path separators (`\\`) in your paths if the `share_type` is not set or defaults to 'posix'.","message":"When interacting with Windows Samba shares, using forward slashes (/) in paths may lead to `STATUS_INVALID_PARAMETER` errors. The underlying `smbclient` library often expects backslashes (\\) or proper handling of path types.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your imports to use `from airflow.providers.samba.hooks.samba import SambaHook`.","message":"The old import path `airflow.hooks.samba_hook` has been deprecated.","severity":"deprecated","affected_versions":"<2.0.0 (provider versions)"},{"fix":"Ensure `pysmbclient` is up-to-date. Verify that Kerberos configuration (keytabs, krb5.conf) is correctly set up for the user running Airflow workers. Consider explicit `auth` parameter in 'Extra' field of the connection if supported by `pysmbclient`'s underlying mechanisms.","message":"Some users have reported issues with Kerberos authentication (`SpnegoError`) when using `SambaHook`, even when direct `smbclient` commands work outside Airflow.","severity":"gotcha","affected_versions":"Older Airflow 2.x versions (e.g., 2.2.0) with provider versions around 4.x.x."}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}