mschmo commented on a change in pull request #13072: URL: https://github.com/apache/airflow/pull/13072#discussion_r550317305
########## File path: airflow/providers/amazon/aws/sensors/glue_crawler.py ########## @@ -0,0 +1,51 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from airflow.exceptions import AirflowException +from airflow.providers.amazon.aws.hooks.glue_crawler import AwsGlueCrawlerHook +from airflow.sensors.base import BaseSensorOperator +from airflow.utils.decorators import apply_defaults + + +class AwsGlueCrawlerSensor(BaseSensorOperator): + """ + Waits for an AWS Glue crawler to reach any of the statuses below + 'FAILED', 'CANCELLED', 'SUCCEEDED' Review comment: FYI after the initial run the crawler's last crawl status will **always** be one of these statuses. Do you think it would make more sense to first check that the crawler is in a "READY" state? I feel like this sensor would be much more useful if it behaved similar to the hook's `wait_for_crawler_completion` and confirmed that the crawler was not currently running. ---------------------------------------------------------------- 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]
