phanikumv commented on code in PR #61681: URL: https://github.com/apache/airflow/pull/61681#discussion_r2839489247
########## providers/apache/spark/src/airflow/providers/apache/spark/operators/spark_pipelines.py: ########## @@ -0,0 +1,151 @@ +# +# 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 __future__ import annotations + +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any + +from airflow.providers.apache.spark.hooks.spark_pipelines import SparkPipelinesHook +from airflow.providers.common.compat.openlineage.utils.spark import ( + inject_parent_job_information_into_spark_properties, + inject_transport_information_into_spark_properties, +) +from airflow.providers.common.compat.sdk import BaseOperator, conf + +if TYPE_CHECKING: + from airflow.providers.common.compat.sdk import Context + + +class SparkPipelinesOperator(BaseOperator): + """ + Execute Spark Declarative Pipelines using the spark-pipelines CLI. + + This operator wraps the spark-pipelines binary to execute declarative data pipelines. + It supports running pipelines, dry-runs for validation, and initializing new pipeline projects. + + .. seealso:: + For more information on Spark Declarative Pipelines, see the guide: + https://spark.apache.org/docs/latest/declarative-pipelines-programming-guide.html + + :param pipeline_spec: Path to the pipeline specification file (YAML). (templated) + :param pipeline_command: The spark-pipelines command to execute ('run', 'dry-run'). Default is 'run'. Review Comment: do we want to add support for the `init` command as well? -- 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]
