ashb commented on pull request #12384:
URL: https://github.com/apache/airflow/pull/12384#issuecomment-728337484


   Just discussed with Daniel: We're going to add (back) a 
`airflow/kubernetes/volume_mount.py` to "core" airflow that contains something 
like:
   
   ```python
   from airflow.providers.cncf.kubernetes.backcompat.volume_mount import 
VolumeMount
   
   warnings.warn(
       "This module is deprecated. Please use 
`kubernetes.client.models.V1Volume`.",
       DeprecationWarning,
       stacklevel=2,
   )
   ```
   
   We may need to wrap that import in a `warnings.catch_warnings, otherwise the 
warning will be reported from the wrong context (we ideally want the 
file:lineno of the warning to be the import line in the user's DAG):
   
   ```python
   import warnings
   
   with warnings.catch_warnings():
       from airflow.providers.cncf.kubernetes.backcompat.volume_mount import 
VolumeMount
   
   warnings.warn(
       "This module is deprecated. Please use 
`kubernetes.client.models.V1Volume`.",
       DeprecationWarning,
       stacklevel=2,
   )
   ```
   
   This means the old imports continue to work, but the bulk of the compat code 
lives in the provider.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to