This is an automated email from the ASF dual-hosted git repository.

husseinawala 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 0470f3af6d Replace assert by if...raise in decorators package (#34250)
0470f3af6d is described below

commit 0470f3af6ddeda0917cd3a0616fa3206bad00236
Author: Hussein Awala <[email protected]>
AuthorDate: Sat Sep 9 23:13:22 2023 +0200

    Replace assert by if...raise in decorators package (#34250)
---
 airflow/decorators/base.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/decorators/base.py b/airflow/decorators/base.py
index 31a354e020..57362e7331 100644
--- a/airflow/decorators/base.py
+++ b/airflow/decorators/base.py
@@ -544,7 +544,8 @@ class DecoratedMappedOperator(MappedOperator):
 
     def _expand_mapped_kwargs(self, context: Context, session: Session) -> 
tuple[Mapping[str, Any], set[int]]:
         # We only use op_kwargs_expand_input so this must always be empty.
-        assert self.expand_input is EXPAND_INPUT_EMPTY
+        if self.expand_input is not EXPAND_INPUT_EMPTY:
+            raise AssertionError(f"unexpected expand_input: 
{self.expand_input}")
         op_kwargs, resolved_oids = super()._expand_mapped_kwargs(context, 
session)
         return {"op_kwargs": op_kwargs}, resolved_oids
 

Reply via email to