eladkal commented on code in PR #32823: URL: https://github.com/apache/airflow/pull/32823#discussion_r1275761384
########## airflow/providers/google/cloud/example_dags/example_dataflow.py: ########## @@ -1,291 +0,0 @@ -# -# 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. -""" -Example Airflow DAG for Google Cloud Dataflow service -""" -from __future__ import annotations - -import os -from datetime import datetime -from typing import Callable -from urllib.parse import urlsplit - -from airflow import models -from airflow.exceptions import AirflowException -from airflow.providers.apache.beam.operators.beam import ( - BeamRunJavaPipelineOperator, - BeamRunPythonPipelineOperator, -) -from airflow.providers.google.cloud.hooks.dataflow import DataflowJobStatus -from airflow.providers.google.cloud.operators.dataflow import ( - CheckJobRunning, - DataflowStopJobOperator, - DataflowTemplatedJobStartOperator, -) -from airflow.providers.google.cloud.sensors.dataflow import ( - DataflowJobAutoScalingEventsSensor, - DataflowJobMessagesSensor, - DataflowJobMetricsSensor, - DataflowJobStatusSensor, -) -from airflow.providers.google.cloud.transfers.gcs_to_local import GCSToLocalFilesystemOperator - -START_DATE = datetime(2021, 1, 1) - -GCS_TMP = os.environ.get("GCP_DATAFLOW_GCS_TMP", "gs://INVALID BUCKET NAME/temp/") -GCS_STAGING = os.environ.get("GCP_DATAFLOW_GCS_STAGING", "gs://INVALID BUCKET NAME/staging/") -GCS_OUTPUT = os.environ.get("GCP_DATAFLOW_GCS_OUTPUT", "gs://INVALID BUCKET NAME/output") -GCS_JAR = os.environ.get("GCP_DATAFLOW_JAR", "gs://INVALID BUCKET NAME/word-count-beam-bundled-0.1.jar") -GCS_PYTHON = os.environ.get("GCP_DATAFLOW_PYTHON", "gs://INVALID BUCKET NAME/wordcount_debugging.py") -PROJECT_ID = os.environ.get("SYSTEM_TESTS_GCP_PROJECT", "default") - -GCS_JAR_PARTS = urlsplit(GCS_JAR) -GCS_JAR_BUCKET_NAME = GCS_JAR_PARTS.netloc -GCS_JAR_OBJECT_NAME = GCS_JAR_PARTS.path[1:] - -default_args = { - "dataflow_default_options": { - "tempLocation": GCS_TMP, - "stagingLocation": GCS_STAGING, - } -} - -with models.DAG( - "example_gcp_dataflow_native_java", - start_date=START_DATE, - catchup=False, - tags=["example"], -) as dag_native_java: - - # [START howto_operator_start_java_job_jar_on_gcs] - start_java_job = BeamRunJavaPipelineOperator( - task_id="start-java-job", - jar=GCS_JAR, - pipeline_options={ - "output": GCS_OUTPUT, - }, - job_class="org.apache.beam.examples.WordCount", - dataflow_config={ - "check_if_running": CheckJobRunning.IgnoreJob, - "location": "europe-west3", - "poll_sleep": 10, - }, - ) - # [END howto_operator_start_java_job_jar_on_gcs] Review Comment: The `howto_operator_start_java_job_jar_on_gcs` tag is being referenced in https://github.com/apache/airflow/blob/410d0c0f86aaec71e2c0050f5adbc53fb7b441e7/docs/apache-airflow-providers-google/operators/cloud/dataflow.rst#L87 You removed it but did not change the rst file. -- 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]
