nuclearpinguin commented on a change in pull request #7506: [AIRFLOW-6877]
[WIP] check cross providers dependencies depends on [AIRFLOW-6663]
URL: https://github.com/apache/airflow/pull/7506#discussion_r382935600
##########
File path: airflow/providers/amazon/aws/operators/s3_to_redshift.py
##########
@@ -15,13 +15,20 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+import warnings
from typing import List, Optional, Union
from airflow.models import BaseOperator
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
-from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.utils.decorators import apply_defaults
+try:
+ from airflow.providers.postgres.hooks.postgres import PostgresHook
+except ImportError:
+ warnings.warn("The package providers-amazon-aws must be installed to use
the operator.",
Review comment:
I am not sure I understand this warning... should it be `postgres` instead
of `provider-amazon-aws`?
----------------------------------------------------------------
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]
With regards,
Apache Git Services