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

shahar1 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 2f7f70ba95e Remove noqa:S101 from production code (#70378)
2f7f70ba95e is described below

commit 2f7f70ba95eb8d047f2fd6f3c98eadff44c835a4
Author: Wei Lee <[email protected]>
AuthorDate: Fri Jul 24 21:36:31 2026 +0800

    Remove noqa:S101 from production code (#70378)
---
 .../src/airflow/providers/common/ai/operators/document_loader.py   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/providers/common/ai/src/airflow/providers/common/ai/operators/document_loader.py
 
b/providers/common/ai/src/airflow/providers/common/ai/operators/document_loader.py
index c59848c144f..217917f8112 100644
--- 
a/providers/common/ai/src/airflow/providers/common/ai/operators/document_loader.py
+++ 
b/providers/common/ai/src/airflow/providers/common/ai/operators/document_loader.py
@@ -155,12 +155,15 @@ class DocumentLoaderOperator(BaseOperator):
             raise ValueError("Provide exactly one of 'source_path' or 
'source_bytes'.")
         if self.source_bytes is not None and self.file_type is None:
             raise ValueError("'file_type' is required when using 
'source_bytes' (e.g. '.pdf').")
+
         if self.source_bytes is not None:
-            assert self.file_type is not None  # noqa: S101 -- enforced above
+            if TYPE_CHECKING:
+                assert self.file_type is not None
             documents = self._parse_bytes(self.source_bytes, self.file_type)
             file_count = 1
         else:
-            assert self.source_path is not None  # noqa: S101 -- enforced above
+            if TYPE_CHECKING:
+                assert self.source_path is not None
             files = self._resolve_files(self.source_path)
             if not files:
                 raise FileNotFoundError(f"No files found matching 
'{self.source_path}'.")

Reply via email to