forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a704290
commit f819e1b
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
metadata-ingestion/src/datahub/ingestion/source/fivetran/connection_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from datahub.ingestion.api.source import CapabilityReport, TestConnectionReport | ||
from datahub.ingestion.source.fivetran.config import FivetranSourceConfig | ||
from datahub.ingestion.source.fivetran.fivetran_log_api import FivetranLogAPI | ||
|
||
|
||
class FivetranConnectionTest: | ||
def __init__(self, config_dict: dict): | ||
self.config = FivetranSourceConfig.parse_obj_allow_extras(config_dict) | ||
|
||
def get_connection_test(self) -> TestConnectionReport: | ||
return TestConnectionReport(basic_connectivity=self.basic_connectivity()) | ||
|
||
def basic_connectivity(self) -> CapabilityReport: | ||
try: | ||
self.audit_log = FivetranLogAPI(self.config.fivetran_log_config) | ||
return CapabilityReport(capable=True) | ||
except Exception as e: | ||
return CapabilityReport(capable=False, failure_reason=str(e)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters