Source code for airflow.providers.google.cloud.links.dataproc
## 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 Google Dataproc links."""from__future__importannotationsimportwarningsfromtypingimportTYPE_CHECKING,Anyimportattrfromairflow.exceptionsimportAirflowProviderDeprecationWarningfromairflow.modelsimportBaseOperatorLink,XComfromairflow.providers.google.cloud.links.baseimportBASE_LINK,BaseGoogleLinkifTYPE_CHECKING:fromairflow.modelsimportBaseOperatorfromairflow.models.taskinstancekeyimportTaskInstanceKeyfromairflow.utils.contextimportContext
[docs]def__getattr__(name:str)->Any:# PEP-562: deprecate module-level variableifname=="DATAPROC_JOB_LOG_LINK":# TODO: remove DATAPROC_JOB_LOG_LINK alias in the next major release# For backward-compatibility, DATAPROC_JOB_LINK was DATAPROC_JOB_LOG_LINK.warnings.warn(("DATAPROC_JOB_LOG_LINK has been deprecated and will be removed in the next MAJOR release."" Please use DATAPROC_JOB_LINK instead"),AirflowProviderDeprecationWarning,stacklevel=2,)returnDATAPROC_JOB_LINKraiseAttributeError(f"module {__name__} has no attribute {name}")
[docs]classDataprocLink(BaseOperatorLink):""" Helper class for constructing Dataproc resource link. .. warning:: This link is pending to deprecate. """
[docs]def__attrs_post_init__(self):# This link is still used into the selected operators# - airflow.providers.google.cloud.operators.dataproc.DataprocScaleClusterOperator# - airflow.providers.google.cloud.operators.dataproc.DataprocJobBaseOperator# - airflow.providers.google.cloud.operators.dataproc.DataprocSubmitPigJobOperator# As soon as we remove reference to this link we might deprecate it by add warning message# with `stacklevel=3` below in this method....
@attr.s(auto_attribs=True)
[docs]classDataprocListLink(BaseOperatorLink):""" Helper class for constructing list of Dataproc resources link. .. warning:: This link is deprecated. """