potiuk commented on code in PR #70531:
URL: https://github.com/apache/airflow/pull/70531#discussion_r3681994659
##########
providers/google/src/airflow/providers/google/cloud/operators/functions.py:
##########
@@ -227,6 +224,12 @@ def extra_links_params(self) -> dict[str, Any]:
}
def execute(self, context: Context):
+ self.zip_path_preprocessor = ZipPathPreprocessor(self.body,
self.zip_path)
Review Comment:
`self.zip_path_preprocessor` is now only assigned here, so between
construction and the first `execute` the attribute doesn't exist at all — any
access raises `AttributeError` rather than returning something sensible. That
affects subclasses, tests, and anything introspecting the operator between
parse and run.
Note you've already handled the sibling case correctly:
`self._field_validator: GcpBodyFieldValidator | None = None` is still
initialised in `__init__` and merely *reassigned* in `execute`. Doing the same
for the preprocessor — declare it as `None` in `__init__`, build it here —
would make the two consistent and keep the operator's attribute surface stable
from construction onwards.
---
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]