potiuk commented on PR #30687:
URL: https://github.com/apache/airflow/pull/30687#issuecomment-1511982965

   Seems that mypy in our main after some more (unrelated) upgraded packages 
started failing. They seem unrelated, but hey, it's MyPy and it's heuristing on 
when to start complaining about things that seemed to be ok earlier after some 
unrelated changes is something that we all got used to I think,
   
   ¯\_(ツ)_/¯
   
   Here is the failure:
   
   https://github.com/apache/airflow/actions/runs/4724060012/jobs/8381284205
   
   Those were the change deps:
   
   ```
   < # This constraints file was automatically generated on 2023-04-17T00:25:15Z
   ---
   > # This constraints file was automatically generated on 2023-04-17T17:55:16Z
   124c124
   < cfn-lint==0.77.0
   ---
   > cfn-lint==0.77.1
   292c292
   < limits==3.3.1
   ---
   > limits==3.4.0
   314c314
   < msal==1.21.0
   ---
   > msal==1.22.0
   483c483
   < soupsieve==2.4
   ---
   > soupsieve==2.4.1
   578c578
   < zstandard==0.20.0
   ---
   > zstandard==0.21.0
   ``` 
   
   And after upgrading those, mypy provider checks  resulted in:
   
   ```
   airflow/providers/openlineage/utils/utils.py:345: error: Argument 1 to 
"asdict"
   has incompatible type "str"; expected "AttrsInstance"  [arg-type]
       ...            for dict_key, subval in attrs.asdict(item, 
recurse=False)....
                                                           ^
   airflow/providers/openlineage/utils/utils.py:345: error: Argument 1 to 
"asdict"
   has incompatible type "Dict[Any, Any]"; expected "AttrsInstance"  [arg-type]
       ...            for dict_key, subval in attrs.asdict(item, 
recurse=False)....
                                                           ^
   airflow/providers/openlineage/utils/utils.py:345: error: Argument 1 to 
"asdict"
   has incompatible type "Tuple[Any, ...]"; expected "AttrsInstance"  [arg-type]
       ...            for dict_key, subval in attrs.asdict(item, 
recurse=False)....
                                                           ^
   airflow/providers/openlineage/utils/utils.py:345: error: Argument 1 to 
"asdict"
   has incompatible type "List[Any]"; expected "AttrsInstance"  [arg-type]
       ...            for dict_key, subval in attrs.asdict(item, 
recurse=False)....
   ```
   
   I  upgraded mypy toi 1.2.0 in the hopes it will understand attrs a bit 
better, but this resulted in few more errors related to attrs (and some other 
small things I fixed in Pydantic AIP-44 classes:
   
   
   ```
   airflow/serialization/serde.py:160: note: Possible overload variants:
   airflow/serialization/serde.py:160: note:     def asdict(obj: 
DataclassInstance) -> Dict[str, Any]
   airflow/serialization/serde.py:160: note:     def [_T] asdict(obj: 
DataclassInstance, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T
   airflow/decorators/task_group.py:117: error: Argument 1 to "evolve" of
   "_TaskGroupFactory[FParams, None]" has incompatible type
   "_TaskGroupFactory[FParams, None]"; expected
   "_TaskGroupFactory[FParams, FReturn]"  [arg-type]
               return attr.evolve(self, tg_kwargs={**self.tg_kwargs, **kwargs...
                                  ^
   airflow/decorators/task_group.py:117: error: Argument 1 to "evolve" of
   "_TaskGroupFactory[FParams, DAGNode]" has incompatible type
   "_TaskGroupFactory[FParams, DAGNode]"; expected
   "_TaskGroupFactory[FParams, FReturn]"  [arg-type]
               return attr.evolve(self, tg_kwargs={**self.tg_kwargs, **kwargs...
                                  ^
   airflow/decorators/task_group.py:123: error: Argument 1 to "evolve" of
   "_TaskGroupFactory[FParams, None]" has incompatible type
   "_TaskGroupFactory[FParams, None]"; expected
   "_TaskGroupFactory[FParams, FReturn]"  [arg-type]
               return attr.evolve(self, partial_kwargs=kwargs)
                                  ^
   airflow/decorators/task_group.py:123: error: Argument 1 to "evolve" of
   "_TaskGroupFactory[FParams, DAGNode]" has incompatible type
   "_TaskGroupFactory[FParams, DAGNode]"; expected
   "_TaskGroupFactory[FParams, FReturn]"  [arg-type]
               return attr.evolve(self, partial_kwargs=kwargs)
   ```
   
   Unless we have a better idea (@uranusjr ?) temporary ignoring those, seem to 
be the best way (And as a bonus we wil have latest-and-greatest MyPy.
   
   
   
   


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