josh-fell commented on issue #19891:
URL: https://github.com/apache/airflow/issues/19891#issuecomment-991095857


   > > > A better fix is
   > > > ```python
   > > > if sys.version_info >= (3, 8):
   > > >     from functools import cached_property
   > > > else:
   > > >     from cached_property import cached_property
   > > > ```
   > > > 
   > > > 
   > > >     
   > > >       
   > > >     
   > > > 
   > > >       
   > > >     
   > > > 
   > > >     
   > > >   
   > > > This is the solution used in `airflow.compat.functools`, which should 
be used by “proper” Airflow code. But providers unfortunately cannot use it 
(yet). Since `cached_property` is a single-use decorator, simply ignoring the 
error is also considered acceptable.
   > > 
   > > 
   > > @uranusjr My recent mypy fix for Azure used that marker in 
`airflow/providers/microsoft/azure/log/wasb_task_handler.py`. Happy to 
implement your suggestion instead if you feel it's best.
   > 
   > Yes please @josh-fell , we can't use `airflow.compat.functools` in 
providers, that module only got added in 2.2.0, so if we use that in providers 
it would need a min airflow version of 2.2.0.
   
   On it. Thanks @ashb. I'll add the version check instead of using the 
`ignore[attr-defined]` comment that's there now.


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