Skip to content

Commit

Permalink
fix(ingest): make gms url configuration resilient in rest emitter (da…
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored Apr 18, 2024
1 parent 91e3dc8 commit d3fb698
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/lineage/airflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Set up a DataHub connection in Airflow, either via command line or the Airflow U
airflow connections add --conn-type 'datahub-rest' 'datahub_rest_default' --conn-host 'http://datahub-gms:8080' --conn-password '<optional datahub auth token>'
```

If you are using hosted Acryl Datahub then please use `https://YOUR_PREFIX.acryl.io/gms` as the `--conn-host` parameter.

#### Airflow UI

On the Airflow UI, go to Admin -> Connections and click the "+" symbol to create a new connection. Select "DataHub REST Server" from the dropdown for "Connection Type" and enter the appropriate values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
datahub_rest_connection_config = Connection(
conn_id="datahub_rest_test",
conn_type="datahub_rest",
host="http://test_host:8080/",
host="http://test_host:8080",
extra=None,
)
datahub_rest_connection_config_with_timeout = Connection(
conn_id="datahub_rest_test",
conn_type="datahub_rest",
host="http://test_host:8080/",
host="http://test_host:8080",
extra=json.dumps({"timeout_sec": 5}),
)

Expand Down
4 changes: 2 additions & 2 deletions metadata-ingestion/src/datahub/emitter/rest_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from requests.adapters import HTTPAdapter, Retry
from requests.exceptions import HTTPError, RequestException

from datahub.cli.cli_utils import get_system_auth
from datahub.cli.cli_utils import fixup_gms_url, get_system_auth
from datahub.configuration.common import ConfigurationError, OperationalError
from datahub.emitter.generic_emitter import Emitter
from datahub.emitter.mcp import MetadataChangeProposalWrapper
Expand Down Expand Up @@ -72,7 +72,7 @@ def __init__(
):
if not gms_server:
raise ConfigurationError("gms server is required")
self._gms_server = gms_server
self._gms_server = fixup_gms_url(gms_server)
self._token = token
self.server_config: Dict[str, Any] = {}

Expand Down

0 comments on commit d3fb698

Please sign in to comment.