Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ingest): add Sandbox support #6105

Merged
merged 2 commits into from
Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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