Skip to content

Commit

Permalink
fix(build): fix for hana build failure for aarch64. (datahub-project#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rslanka authored and maggiehays committed Aug 1, 2022
1 parent a7d9c94 commit 6f69404
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions metadata-ingestion/tests/integration/hana/test_hana.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import platform

import pytest
from freezegun import freeze_time

Expand All @@ -10,6 +12,10 @@

@freeze_time(FROZEN_TIME)
@pytest.mark.slow_integration
@pytest.mark.skipif(
platform.machine().lower() == "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"

Expand Down
16 changes: 16 additions & 0 deletions metadata-ingestion/tests/unit/test_hana_source.py
Original file line number Diff line number Diff line change
@@ -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",
reason="The hdbcli dependency is not available for aarch64",
)
def test_platform_correctly_set_hana():
source = HanaSource(
ctx=PipelineContext(run_id="hana-source-test"),
Expand All @@ -10,6 +18,10 @@ def test_platform_correctly_set_hana():
assert source.platform == "hana"


@pytest.mark.skipif(
platform.machine().lower() == "aarch64",
reason="The hdbcli dependency is not available for aarch64",
)
def test_hana_uri_native():
config = HanaConfig.parse_obj(
{
Expand All @@ -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",
reason="The hdbcli dependency is not available for aarch64",
)
def test_hana_uri_native_db():
config = HanaConfig.parse_obj(
{
Expand Down

0 comments on commit 6f69404

Please sign in to comment.