Repository: apache/airflow
File: providers/google/tests/system/google/cloud/cloud_run/example_cloud_run.py (Python)

Code before:
        "task_count": 1,
        "timeout": "60s",
    }

    execute3 = CloudRunExecuteJobOperator(
        task_id=execute3_task_name,
        project_id=PROJECT_ID,
        region=region,
        overrides=overrides,
        job_name=job3_name,
        dag=dag,
        deferrable=False,
    )
    # [END howto_operator_cloud_run_execute_job_with_overrides]

    execute4 = CloudRunExecuteJobOperator(
        task_id=execute4_task_name,
        project_id=PROJECT_ID,
        region=region,
        job_name=job4_name,
        dag=dag,
        deferrable=False,
        transport="rest",
    )

    # [START howto_operator_cloud_run_execute_job_deferrable_rest]
    execute5 = CloudRunExecuteJobOperator(
        task_id=execute5_task_name,
        project_id=PROJECT_ID,
        region=region,
        job_name=job5_name,
        dag=dag,
        deferrable=True,
        transport="rest",
    )
    # [END howto_operator_cloud_run_execute_job_deferrable_rest]

    assert_executed_jobs = PythonOperator(
        task_id="assert-executed-jobs", python_callable=_assert_executed_jobs_xcom, dag=dag
    )

    list_jobs_limit = CloudRunListJobsOperator(
        task_id=list_jobs_limit_task_name, project_id=PROJECT_ID, region=region, dag=dag, limit=1
    )

    assert_jobs_limit = PythonOperator(task_id="assert-jobs-limit", python_callable=_assert_one_job, dag=dag)

    # [START howto_operator_cloud_run_list_jobs]
    list_jobs = CloudRunListJobsOperator(
        task_id=list_jobs_task_name, project_id=PROJECT_ID, region=region, dag=dag
    )

Review comment (refactor):
@eladkal could you remove this tag or add to the documentation, because in the current time I do not see any usage of this tag?

Code after:
        "task_count": 1,
        "timeout": "60s",
    }

    execute3 = CloudRunExecuteJobOperator(
        task_id=execute3_task_name,
        project_id=PROJECT_ID,
        region=region,
        overrides=overrides,
        job_name=job3_name,
        dag=dag,
        deferrable=False,
    )
    # [END howto_operator_cloud_run_execute_job_with_overrides]

    execute4 = CloudRunExecuteJobOperator(
        task_id=execute4_task_name,
        project_id=PROJECT_ID,
        region=region,
        job_name=job4_name,
        dag=dag,
        deferrable=False,
        transport="rest",
    )

    execute5 = CloudRunExecuteJobOperator(
        task_id=execute5_task_name,
        project_id=PROJECT_ID,
        region=region,
        job_name=job5_name,
        dag=dag,
        deferrable=True,
        transport="rest",
    )

    assert_executed_jobs = PythonOperator(
        task_id="assert-executed-jobs", python_callable=_assert_executed_jobs_xcom, dag=dag
    )

    list_jobs_limit = CloudRunListJobsOperator(
        task_id=list_jobs_limit_task_name, project_id=PROJECT_ID, region=region, dag=dag, limit=1
    )

    assert_jobs_limit = PythonOperator(task_id="assert-jobs-limit", python_callable=_assert_one_job, dag=dag)

    # [START howto_operator_cloud_run_list_jobs]
    list_jobs = CloudRunListJobsOperator(
        task_id=list_jobs_task_name, project_id=PROJECT_ID, region=region, dag=dag
    )
    # [END howto_operator_cloud_run_list_jobs]