uranusjr commented on a change in pull request #21054:
URL: https://github.com/apache/airflow/pull/21054#discussion_r790425169
##########
File path: airflow/models/baseoperator.py
##########
@@ -1351,10 +1367,16 @@ def dry_run(self) -> None:
"""Performs dry run for the operator - just render template fields."""
self.log.info('Dry run')
for field in self.template_fields:
- content = getattr(self, field)
- if content and isinstance(content, str):
- self.log.info('Rendering template for %s', field)
- self.log.info(content)
+ if hasattr(self, field):
+ content = getattr(self, field)
+ if content and isinstance(content, str):
+ self.log.info('Rendering template for %s', field)
+ self.log.info(content)
+ else:
+ raise AttributeError(
+ f"{field!r} is configured as a template field "
+ f"but {self.task_type} does not have this attribute."
+ )
Review comment:
Same as above.
--
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]