From d52fde126fa33693e53cc764d09842f045f84a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roko=20Gudi=C4=87?= Date: Tue, 4 Oct 2022 18:05:53 +0200 Subject: [PATCH] feat(ingest): salesforce - add sandbox support (#6105) Co-authored-by: rgudic --- .../src/datahub/ingestion/source/salesforce.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metadata-ingestion/src/datahub/ingestion/source/salesforce.py b/metadata-ingestion/src/datahub/ingestion/source/salesforce.py index cfbff4b018f549..7b9ab6dd789b9d 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/salesforce.py +++ b/metadata-ingestion/src/datahub/ingestion/source/salesforce.py @@ -90,6 +90,10 @@ class SalesforceConfig(DatasetSourceConfigBase): instance_url: Optional[str] = Field( description="Salesforce instance url. e.g. https://MyDomainName.my.salesforce.com" ) + # Flag to indicate whether the instance is production or sandbox + is_sandbox: bool = Field( + default=False, description="Connect to Sandbox instance of your Salesforce" + ) access_token: Optional[str] = Field(description="Access token for instance url") ingest_tags: Optional[bool] = Field( @@ -206,6 +210,7 @@ def __init__(self, config: SalesforceConfig, ctx: PipelineContext) -> None: instance_url=self.config.instance_url, session_id=self.config.access_token, session=self.session, + domain="test" if self.config.is_sandbox else None, ) elif self.config.auth is SalesforceAuthType.USERNAME_PASSWORD: logger.debug("Username/Password Provided in Config") @@ -224,6 +229,7 @@ def __init__(self, config: SalesforceConfig, ctx: PipelineContext) -> None: password=self.config.password, security_token=self.config.security_token, session=self.session, + domain="test" if self.config.is_sandbox else None, ) except Exception as e: