dabla commented on PR #38111:
URL: https://github.com/apache/airflow/pull/38111#issuecomment-2050133314

   > > Now I'm getting this 
[errors](https://github.com/apache/airflow/actions/runs/8648788861/job/23713776144?pr=38111#step:10:2621)
 probably something else needs to be changed/excluded so it's not run in 2.6.0 
anymore?
   > 
   > Yeah. One more small thing - the check attempt to import provider code 
(and in this case they attempt to import transfer operators from GCS that are 
importing azure hooks (and the hooks are not there) - so
   > 
   > BAsically you need to wrap the failing imports with 
AirflowOptionalProviderFeatureException like described here:
   > 
   > 
https://github.com/apache/airflow/blob/main/airflow/providers/MANAGING_PROVIDERS_LIFECYCLE.rst#additional-changes-needed-for-cross-dependent-providers
   > 
   > Yes. Not straightforward, but it's close
   
   Thanks Jarek, couldn't we adapt the verify_providers module as that is the 
one that causing the import issue and check the if the imported module isn't an 
ignored providers from BASE_PROVIDERS_COMPATIBILITY_CHECKS?  Or will it fail 
further down anyway?  I ask this a I don't feel very comfortable doing a 
try/except of an ImportError in like production code, because that would mean I 
would have to adapt that in the azure_blob_to_s" module for example, it would 
then become this if I'm not mistaken:
   
   ```
   from __future__ import annotations
   
   import os
   import tempfile
   from typing import TYPE_CHECKING, Sequence
   
   from airflow.models import BaseOperator
   from airflow.providers.amazon.aws.hooks.s3 import S3Hook
   try:
       from airflow.providers.microsoft.azure.hooks.wasb import WasbHook
   except ModuleNotFoundError as e:
       from airflow.exceptions import AirflowOptionalProviderFeatureException
   
       raise AirflowOptionalProviderFeatureException(e)
   
   if TYPE_CHECKING:
       from airflow.utils.context import Context
   
   
   class AzureBlobStorageToS3Operator(BaseOperator):
   ```
   
   But if you confirm this is fine then no problem I would do it like this :)


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