Skip to content

Update mocking connections docs to use task SDK Connection.get (#63996)#64014

Open
deepujain wants to merge 1 commit intoapache:mainfrom
deepujain:fix-63996-docs-mock-connections-task-sdk
Open

Update mocking connections docs to use task SDK Connection.get (#63996)#64014
deepujain wants to merge 1 commit intoapache:mainfrom
deepujain:fix-63996-docs-mock-connections-task-sdk

Conversation

@deepujain
Copy link
Contributor

Summary

The "Mocking variables and connections" section in best-practices.rst used
the deprecated Connection.get_connection_from_secrets() from airflow.models.
Updated to use Connection.get() from airflow.sdk, which is the Airflow 3.x
standard (consistent with Variable.get() already shown in the same section).

Changes

  • airflow-core/docs/best-practices.rst: Added from airflow.sdk import Connection
    import and replaced Connection.get_connection_from_secrets("my_conn") with
    Connection.get("my_conn") in the connection mocking example.

Fixes #63996

Copy link
Collaborator

@jroachgolf84 jroachgolf84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'm not a maintainer, so my approval doesn't hold weight for getting this merged.

@potiuk potiuk force-pushed the fix-63996-docs-mock-connections-task-sdk branch from c9c0005 to 347b73d Compare March 21, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants