From b431fe6c622b67ff340227d17e4cde8aec90c5b9 Mon Sep 17 00:00:00 2001 From: Ravindra Lanka Date: Thu, 26 May 2022 11:46:44 -0700 Subject: [PATCH 1/2] Fix for hana build failure for aarch64. --- metadata-ingestion/setup.py | 6 +++++- .../tests/integration/hana/test_hana.py | 6 ++++++ .../tests/unit/test_hana_source.py | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/metadata-ingestion/setup.py b/metadata-ingestion/setup.py index 8ec8038c31fb54..dfba574cc27512 100644 --- a/metadata-ingestion/setup.py +++ b/metadata-ingestion/setup.py @@ -201,7 +201,11 @@ def get_long_description(): "feast": {"feast==0.18.0", "flask-openid>=1.3.0"}, "glue": aws_common, # hdbcli is supported officially by SAP, sqlalchemy-hana is built on top but not officially supported - "hana": sql_common | {"sqlalchemy-hana>=0.5.0", "hdbcli>=2.11.20"}, + "hana": sql_common + | { + "sqlalchemy-hana>=0.5.0; platform_machine != 'aarch64'", + "hdbcli>=2.11.20; platform_machine != 'aarch64'", + }, "hive": sql_common | { # Acryl Data maintains a fork of PyHive diff --git a/metadata-ingestion/tests/integration/hana/test_hana.py b/metadata-ingestion/tests/integration/hana/test_hana.py index 35efd4b38bc4e3..f6fb6fe654bff4 100644 --- a/metadata-ingestion/tests/integration/hana/test_hana.py +++ b/metadata-ingestion/tests/integration/hana/test_hana.py @@ -1,3 +1,5 @@ +import platform + import pytest from freezegun import freeze_time @@ -10,6 +12,10 @@ @freeze_time(FROZEN_TIME) @pytest.mark.slow_integration +@pytest.mark.skipif( + platform.machine().lower() == "aarch64", + "The hdbcli dependency is not available for aarch64", +) def test_hana_ingest(docker_compose_runner, pytestconfig, tmp_path, mock_time): test_resources_dir = pytestconfig.rootpath / "tests/integration/hana" diff --git a/metadata-ingestion/tests/unit/test_hana_source.py b/metadata-ingestion/tests/unit/test_hana_source.py index f096512e573eec..c2d2b073ae550d 100644 --- a/metadata-ingestion/tests/unit/test_hana_source.py +++ b/metadata-ingestion/tests/unit/test_hana_source.py @@ -1,7 +1,15 @@ +import platform + +import pytest + from datahub.ingestion.api.common import PipelineContext from datahub.ingestion.source.sql.hana import HanaConfig, HanaSource +@pytest.mark.skipif( + platform.machine().lower() == "aarch64", + "The hdbcli dependency is not available for aarch64", +) def test_platform_correctly_set_hana(): source = HanaSource( ctx=PipelineContext(run_id="hana-source-test"), @@ -10,6 +18,10 @@ def test_platform_correctly_set_hana(): assert source.platform == "hana" +@pytest.mark.skipif( + platform.machine().lower() == "aarch64", + "The hdbcli dependency is not available for aarch64", +) def test_hana_uri_native(): config = HanaConfig.parse_obj( { @@ -22,6 +34,10 @@ def test_hana_uri_native(): assert config.get_sql_alchemy_url() == "hana+hdbcli://user:password@host:39041" +@pytest.mark.skipif( + platform.machine().lower() == "aarch64", + "The hdbcli dependency is not available for aarch64", +) def test_hana_uri_native_db(): config = HanaConfig.parse_obj( { From b81da10e1da835be7ef82084adbcfb7e250bff49 Mon Sep 17 00:00:00 2001 From: Ravindra Lanka Date: Thu, 26 May 2022 12:08:29 -0700 Subject: [PATCH 2/2] Add reason kwd to skipif --- metadata-ingestion/tests/integration/hana/test_hana.py | 2 +- metadata-ingestion/tests/unit/test_hana_source.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata-ingestion/tests/integration/hana/test_hana.py b/metadata-ingestion/tests/integration/hana/test_hana.py index f6fb6fe654bff4..8982c86ddc2bad 100644 --- a/metadata-ingestion/tests/integration/hana/test_hana.py +++ b/metadata-ingestion/tests/integration/hana/test_hana.py @@ -14,7 +14,7 @@ @pytest.mark.slow_integration @pytest.mark.skipif( platform.machine().lower() == "aarch64", - "The hdbcli dependency is not available for aarch64", + reason="The hdbcli dependency is not available for aarch64", ) def test_hana_ingest(docker_compose_runner, pytestconfig, tmp_path, mock_time): test_resources_dir = pytestconfig.rootpath / "tests/integration/hana" diff --git a/metadata-ingestion/tests/unit/test_hana_source.py b/metadata-ingestion/tests/unit/test_hana_source.py index c2d2b073ae550d..aa9d37069092e3 100644 --- a/metadata-ingestion/tests/unit/test_hana_source.py +++ b/metadata-ingestion/tests/unit/test_hana_source.py @@ -8,7 +8,7 @@ @pytest.mark.skipif( platform.machine().lower() == "aarch64", - "The hdbcli dependency is not available for aarch64", + reason="The hdbcli dependency is not available for aarch64", ) def test_platform_correctly_set_hana(): source = HanaSource( @@ -20,7 +20,7 @@ def test_platform_correctly_set_hana(): @pytest.mark.skipif( platform.machine().lower() == "aarch64", - "The hdbcli dependency is not available for aarch64", + reason="The hdbcli dependency is not available for aarch64", ) def test_hana_uri_native(): config = HanaConfig.parse_obj( @@ -36,7 +36,7 @@ def test_hana_uri_native(): @pytest.mark.skipif( platform.machine().lower() == "aarch64", - "The hdbcli dependency is not available for aarch64", + reason="The hdbcli dependency is not available for aarch64", ) def test_hana_uri_native_db(): config = HanaConfig.parse_obj(