uranusjr commented on pull request #21815:
URL: https://github.com/apache/airflow/pull/21815#issuecomment-1050548246


   This gets me pass the error, but hits another one:
   
   ```
   Traceback (most recent call last):
     File "dags/t.py", line 23, in <module>
       target_time=templates_xcomarg
     File "/opt/airflow/airflow/models/mappedoperator.py", line 215, in apply
       end_date=end_date,
     File "<attrs generated init 
airflow.models.mappedoperator.MappedOperator>", line 24, in __init__
     File "/opt/airflow/airflow/models/mappedoperator.py", line 259, in 
__attrs_post_init__
       self._validate_argument_count()
     File "/opt/airflow/airflow/models/mappedoperator.py", line 300, in 
_validate_argument_count
       op = self._create_unmapped_operator(mapped_kwargs=mocked_mapped_kwargs, 
real=False)
     File "/opt/airflow/airflow/models/mappedoperator.py", line 453, in 
_create_unmapped_operator
       **mapped_kwargs,
     File "/opt/airflow/airflow/models/baseoperator.py", line 374, in 
apply_defaults
       result = func(self, **kwargs, default_args=default_args)
     File "/opt/airflow/airflow/sensors/date_time.py", line 69, in __init__
       f"Expected str or datetime.datetime type for target_time. Got 
{type(target_time)}"
   TypeError: Expected str or datetime.datetime type for target_time. Got 
<class 'unittest.mock.MagicMock'>
   ```
   
   I guess we do need a class-level `validate` hook on operators.


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