dstandish commented on code in PR #37851:
URL: https://github.com/apache/airflow/pull/37851#discussion_r1510093335


##########
airflow/serialization/pydantic/taskinstance.py:
##########
@@ -106,14 +107,59 @@ class TaskInstancePydantic(BaseModelPydantic, 
LoggingMixin):
     trigger_timeout: Optional[datetime]
     next_method: Optional[str]
     next_kwargs: Optional[dict]
-    run_as_user: Optional[str]
-    task: PydanticOperator
+    run_as_user: Optional[str] = None
+    task: Optional[PydanticOperator] = None
     test_mode: bool
     dag_run: Optional[DagRunPydantic]
     dag_model: Optional[DagModelPydantic]
-
+    raw: Optional[bool] = None
+    is_trigger_log_context: Optional[bool] = False
     model_config = ConfigDict(from_attributes=True, 
arbitrary_types_allowed=True)
 
+    @property
+    def _logger_name(self):

Review Comment:
   in TaskInstance model, we use a "reconstructor" to override `self._log` so 
that the name is correct. the better way to do this is use the existing logic 
in LoggingMixin which looks at this attr, `_logger_name`.  For pydantic model, 
we don't have a "reconstructor" or an init or post init, so we can' tdo it 
there.  and when i just add `_logger_name` as class attr (overriding 
loggingmixin) it doesn't work!  but defining a property does.



-- 
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]

Reply via email to