eladkal commented on code in PR #45354: URL: https://github.com/apache/airflow/pull/45354#discussion_r1906208050
########## providers/src/airflow/providers/google/common/hooks/operation_helpers.py: ########## @@ -0,0 +1,79 @@ +# +# 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. +"""This module contains a helper class to work with `google.api_core.operation.Operation` object.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from google.api_core.exceptions import GoogleAPICallError +from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault + +from airflow.exceptions import AirflowException + +if TYPE_CHECKING: + from google.api_core.operation import Operation + from google.api_core.retry import Retry + from proto import Message + + +class OperationHelper: Review Comment: I wonder if this should be provider specific. Users work with multiple peoviders, they also subclass, extend and use tooling we offer extensively. Its a real pain when providers behave differently with samilar patterns. The pattern of `Wait for long-lasting operation result to be retrieved` is not not unique to Google. I think we need to discuss this in a scope larger than just Google 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
