Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ def convert_asset_to_openlineage(asset: Asset, lineage_context) -> OpenLineageDa
from airflow.providers.common.compat.openlineage.facet import Dataset as OpenLineageDataset

parsed = urlsplit(asset.uri)
path = parsed.path[1:] if parsed.path.startswith("/") else parsed.path
return OpenLineageDataset(namespace=f"hdfs://{parsed.netloc}", name=path or "/")
return OpenLineageDataset(namespace=f"hdfs://{parsed.netloc}", name=parsed.path.lstrip("/") or "/")
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def test_create_asset(path: str, expected_uri: str) -> None:
[
pytest.param("/", "hdfs://namenode:8020", id="no-path"),
pytest.param("/", "hdfs://namenode:8020/", id="path-slash-only"),
pytest.param("/data/file.csv", "hdfs://namenode:8020//data/file.csv", id="root"),
pytest.param("data/file.csv", "hdfs://namenode:8020//data/file.csv", id="root"),
pytest.param("data/file.csv", "hdfs://namenode:8020/data/file.csv", id="no-leading-slash"),
pytest.param("//data/file.csv", "hdfs://namenode:8020///data/file.csv", id="two-slashes"),
pytest.param("data/file.csv", "hdfs://namenode:8020///data/file.csv", id="two-slashes"),
],
)
def test_convert_asset_to_openlineage(expected_name, uri) -> None:
Expand Down
3 changes: 1 addition & 2 deletions providers/ftp/src/airflow/providers/ftp/assets/ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ def convert_asset_to_openlineage(asset: Asset, lineage_context) -> OpenLineageDa
from airflow.providers.common.compat.openlineage.facet import Dataset as OpenLineageDataset

parsed = urlsplit(asset.uri)
path = parsed.path[1:] if parsed.path.startswith("/") else parsed.path
return OpenLineageDataset(namespace=f"file://{parsed.netloc}", name=path or "/")
return OpenLineageDataset(namespace=f"file://{parsed.netloc}", name=parsed.path.lstrip("/") or "/")
4 changes: 2 additions & 2 deletions providers/ftp/tests/unit/ftp/assets/test_ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def test_create_asset(path: str, expected_uri: str) -> None:
[
pytest.param("/", "ftp://example.com:21", id="no-path"),
pytest.param("/", "ftp://example.com:21/", id="path-slash-only"),
pytest.param("/data/file.csv", "ftp://example.com:21//data/file.csv", id="root"),
pytest.param("data/file.csv", "ftp://example.com:21//data/file.csv", id="root"),
pytest.param("data/file.csv", "ftp://example.com:21/data/file.csv", id="no-leading-slash"),
pytest.param("//data/file.csv", "ftp://example.com:21///data/file.csv", id="two-slashes"),
pytest.param("data/file.csv", "ftp://example.com:21///data/file.csv", id="two-slashes"),
],
)
def test_convert_asset_to_openlineage(expected_name, uri) -> None:
Expand Down
19 changes: 10 additions & 9 deletions providers/microsoft/mssql/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,16 @@ Requirements

The minimum Apache Airflow version supported by this provider distribution is ``2.11.0``.

======================================= ======================================
PIP package Version required
======================================= ======================================
``apache-airflow`` ``>=2.11.0``
``apache-airflow-providers-common-sql`` ``>=1.32.0``
``pymssql`` ``>=2.3.5; python_version < "3.14"``
``pymssql`` ``>=2.3.13; python_version >= "3.14"``
``methodtools`` ``>=0.4.7``
======================================= ======================================
========================================== ======================================
PIP package Version required
========================================== ======================================
``apache-airflow`` ``>=2.11.0``
``apache-airflow-providers-common-sql`` ``>=1.32.0``
``apache-airflow-providers-common-compat`` ``>=1.12.0``
``pymssql`` ``>=2.3.5; python_version < "3.14"``
``pymssql`` ``>=2.3.13; python_version >= "3.14"``
``methodtools`` ``>=0.4.7``
========================================== ======================================

Cross provider package dependencies
-----------------------------------
Expand Down
4 changes: 1 addition & 3 deletions providers/microsoft/mssql/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ requires-python = ">=3.10"
dependencies = [
"apache-airflow>=2.11.0",
"apache-airflow-providers-common-sql>=1.32.0",
"apache-airflow-providers-common-compat>=1.12.0",
"pymssql>=2.3.5; python_version < '3.14'",
"pymssql>=2.3.13; python_version >= '3.14'",
"methodtools>=0.4.7",
Expand All @@ -72,9 +73,6 @@ dependencies = [
"openlineage" = [
"apache-airflow-providers-openlineage"
]
"common.compat" = [
"apache-airflow-providers-common-compat"
]

[dependency-groups]
dev = [
Expand Down
4 changes: 2 additions & 2 deletions providers/mysql/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ connection-types:
connection-type: mysql

asset-uris:
- schemes: [mysql]
- schemes: [mysql, mariadb]
handler: airflow.providers.mysql.assets.mysql.sanitize_uri
factory: airflow.providers.mysql.assets.mysql.create_asset
to_openlineage_converter: airflow.providers.mysql.assets.mysql.convert_asset_to_openlineage

# dataset has been renamed to asset in Airflow 3.0
# This is kept for backward compatibility.
dataset-uris:
- schemes: [mysql]
- schemes: [mysql, mariadb]
handler: airflow.providers.mysql.assets.mysql.sanitize_uri
factory: airflow.providers.mysql.assets.mysql.create_asset
to_openlineage_converter: airflow.providers.mysql.assets.mysql.convert_asset_to_openlineage
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def get_provider_info():
],
"asset-uris": [
{
"schemes": ["mysql"],
"schemes": ["mysql", "mariadb"],
"handler": "airflow.providers.mysql.assets.mysql.sanitize_uri",
"factory": "airflow.providers.mysql.assets.mysql.create_asset",
"to_openlineage_converter": "airflow.providers.mysql.assets.mysql.convert_asset_to_openlineage",
}
],
"dataset-uris": [
{
"schemes": ["mysql"],
"schemes": ["mysql", "mariadb"],
"handler": "airflow.providers.mysql.assets.mysql.sanitize_uri",
"factory": "airflow.providers.mysql.assets.mysql.create_asset",
"to_openlineage_converter": "airflow.providers.mysql.assets.mysql.convert_asset_to_openlineage",
Expand Down
3 changes: 1 addition & 2 deletions providers/sftp/src/airflow/providers/sftp/assets/sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ def convert_asset_to_openlineage(asset: Asset, lineage_context) -> OpenLineageDa
from airflow.providers.common.compat.openlineage.facet import Dataset as OpenLineageDataset

parsed = urlsplit(asset.uri)
path = parsed.path[1:] if parsed.path.startswith("/") else parsed.path
return OpenLineageDataset(namespace=f"file://{parsed.netloc}", name=path or "/")
return OpenLineageDataset(namespace=f"file://{parsed.netloc}", name=parsed.path.lstrip("/") or "/")
4 changes: 2 additions & 2 deletions providers/sftp/tests/unit/sftp/assets/test_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def test_create_asset(path: str, expected_uri: str) -> None:
[
pytest.param("/", "sftp://example.com:22", id="no-path"),
pytest.param("/", "sftp://example.com:22/", id="path-slash-only"),
pytest.param("/data/file.csv", "sftp://example.com:22//data/file.csv", id="root"),
pytest.param("data/file.csv", "sftp://example.com:22//data/file.csv", id="root"),
pytest.param("data/file.csv", "sftp://example.com:22/data/file.csv", id="no-leading-slash"),
pytest.param("//data/file.csv", "sftp://example.com:22///data/file.csv", id="two-slashes"),
pytest.param("data/file.csv", "sftp://example.com:22///data/file.csv", id="two-slashes"),
],
)
def test_convert_asset_to_openlineage(expected_name, uri) -> None:
Expand Down
14 changes: 7 additions & 7 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading