Taragolis commented on PR #39205:
URL: https://github.com/apache/airflow/pull/39205#issuecomment-2073401368

   Personally I more for the `@deprecated` from the warning/typing_extension 
rather than [Deprecation](https://pypi.org/project/Deprecated/) module even if 
it not supports `deprecated_since`/`version` by design but it should supported 
more widely by third-parties tools/IDEs, and also it become in some (most) 
cases runtime checkable.
   
   In general `warnings.warn` supports provide Warning object instead of 
message + category:
   
   ```python
   import warnings
   from airflow.exceptions import AirflowProviderDeprecationWarning
   
   wrn = AirflowProviderDeprecationWarning("FooBar")
   wrn.deprecated_provider_since = "42.0.1"
   warnings.warn(wrn)
   ```
   
   But this one not supported by the decorators because it is expected to have 
message a string literal and category as a class, and also there is no point to 
set `deprecated_provider_since` because it doesn't have any affect.
   


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