You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2025/03/17 11:19:31 UTC
(airflow) branch main updated: Fix deprecation warning for `BranchMixIn` (#47856)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new d0bcc028af5 Fix deprecation warning for `BranchMixIn` (#47856)
d0bcc028af5 is described below
commit d0bcc028af5180e35779ecea8696ac1cec11282e
Author: Kaxil Naik <ka...@apache.org>
AuthorDate: Mon Mar 17 16:49:24 2025 +0530
Fix deprecation warning for `BranchMixIn` (#47856)
Before:
```
/opt/airflow/providers/standard/src/airflow/providers/standard/operators/python.py:46 DeprecationWarning: The `airflow.operators.branch.BranchMixIn` class is deprecated. Please use `'airflow.providers.standard.operators.branch.BranchMixIn'`.
```
This is fixed by this PR.
---
providers/standard/src/airflow/providers/standard/operators/python.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/providers/standard/src/airflow/providers/standard/operators/python.py b/providers/standard/src/airflow/providers/standard/operators/python.py
index 628e56c1863..2ac571eac25 100644
--- a/providers/standard/src/airflow/providers/standard/operators/python.py
+++ b/providers/standard/src/airflow/providers/standard/operators/python.py
@@ -43,7 +43,6 @@ from airflow.exceptions import (
)
from airflow.models.baseoperator import BaseOperator
from airflow.models.variable import Variable
-from airflow.operators.branch import BranchMixIn
from airflow.providers.standard.utils.python_virtualenv import prepare_virtualenv, write_python_script
from airflow.providers.standard.version_compat import AIRFLOW_V_2_10_PLUS, AIRFLOW_V_3_0_PLUS
from airflow.utils import hashlib_wrapper
@@ -53,9 +52,11 @@ from airflow.utils.operator_helpers import KeywordParameters
from airflow.utils.process_utils import execute_in_subprocess, execute_in_subprocess_with_kwargs
if AIRFLOW_V_3_0_PLUS:
+ from airflow.providers.standard.operators.branch import BranchMixIn
from airflow.providers.standard.utils.skipmixin import SkipMixin
else:
from airflow.models.skipmixin import SkipMixin
+ from airflow.operators.branch import BranchMixIn
log = logging.getLogger(__name__)