Skip to content

DatabricksSqlHook.get_conn() passes deprecated _user_agent_entry to databricks-sql-connector #72102

Description

@peloyeje

Apache Airflow version

2.11.0 (also reproduces on main, provider 7.19.0)

If "Other Airflow 2 version" selected, which one?

No response

What happened

Every call to DatabricksSqlHook.get_conn() (used by DatabricksSqlOperator, Databricks SQL sensors, etc.) logs this warning:

[WARN] Parameter '_user_agent_entry' is deprecated; use 'user_agent_entry' instead. This parameter will be removed in the upcoming releases.

Steps to reproduce:

  1. Set up a Databricks SQL connection.
  2. Run any task that opens a connection through DatabricksSqlHook (e.g. DatabricksSqlOperator).
  3. Check the task log. The warning fires on every new connection.

Cause: databricks_sql.py builds connect_kwargs with the key _user_agent_entry (leading underscore) when calling sql.connect(). databricks-sql-connector's Session.__init__ only reads user_agent_entry directly; it falls back to _user_agent_entry for backward compatibility and logs the deprecation warning each time it's used.

What you think should happen instead

The hook should pass user_agent_entry (no underscore), the current parameter name. This isn't a behavior change: user_agent_entry has been supported by databricks-sql-connector for multiple releases, and the provider on main already pins databricks-sql-connector>=4.4.0, well above where the non-underscore parameter was introduced.

How to reproduce

See steps above.

Operating System

Any (reproduces regardless of OS)

Versions of Apache Airflow Providers

apache-airflow-providers-databricks==7.12.0
databricks-sql-connector==4.2.5

Deployment

Other

Deployment details

No response

Anything else

I have a one-line fix ready and will open a PR against this issue.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions