Skip to content

Airflow SalesforceHook empty security token #23910

Description

@parvezmkhan

Apache Airflow version

2.2.2

What happened

When creating salesforce hook like below get
sf = SalesforceHook(salesforce_conn_id="test_sf")

Get below TypeError
You must provide login information or an instance and token

This is test salesforce domain.
User name and password are set correctly in Airflow connection but security token is not filled.
I expect the connection to setup without error

What you think should happen instead

Changing

security_token=extras.get('extra__salesforce__security_token') or None,

to below works, i.e. connection is established
security_token=extras["extra__salesforce__security_token"] or '',

How to reproduce

Setup salesforce connection in airflow with

  • user name, password and no security token
  • domain : test
  • API version : 54.0

Operating System

macOS 11.2.3

Versions of Apache Airflow Providers

apache-airflow-providers-salesforce 3.3.0
simple-salesforce 1.11.4

Deployment

Virtualenv installation

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions