Skip to content

Commit

Permalink
feat(ingest): salesforce - add sandbox support (#6105)
Browse files Browse the repository at this point in the history
Co-authored-by: rgudic <[email protected]>
  • Loading branch information
rgudic and rgudic authored Oct 4, 2022
1 parent e2c5d2a commit d52fde1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/source/salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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")
Expand All @@ -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:
Expand Down

0 comments on commit d52fde1

Please sign in to comment.