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

Fixes #17869: Add validations in place for salesforce connection #17870

Merged
merged 7 commits into from
Sep 20, 2024
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from typing import Optional

from simple_salesforce.api import Salesforce
from sqlalchemy.engine import Engine

from metadata.generated.schema.entity.automations.workflow import (
Workflow as AutomationWorkflow,
Expand All @@ -27,14 +26,18 @@
from metadata.ingestion.ometa.ometa_api import OpenMetadata


def get_connection(connection: SalesforceConnection) -> Engine:
def get_connection(connection: SalesforceConnection):
"""
Create connection
"""
return Salesforce(
username=connection.username,
password=connection.password.get_secret_value(),
security_token=connection.securityToken.get_secret_value(),
password=connection.password.get_secret_value()
if connection.password
else None,
security_token=connection.securityToken.get_secret_value()
if connection.securityToken
else None,
domain=connection.salesforceDomain,
version=connection.salesforceApiVersion,
**connection.connectionArguments.root if connection.connectionArguments else {},
Expand Down
Loading