This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-7-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 855d4684e9a966801da921d7a145a52a2a645014
Author: eladkal <[email protected]>
AuthorDate: Sat Aug 5 10:06:12 2023 +0300

    Clean `schedule_interval` usages from example dags (#33131)
    
    * Clean `schedule_interval` usages from example dags
    
    * Fix Pytest parameter name to match test argument
    
    ---------
    
    Co-authored-by: Tzu-ping Chung <[email protected]>
    (cherry picked from commit cdea9f176ca8f9882bd41c9c198b03421dbfc298)
---
 tests/jobs/test_backfill_job.py                                   | 2 +-
 tests/providers/openlineage/extractors/test_bash_extractor.py     | 2 +-
 tests/providers/openlineage/extractors/test_python_extractor.py   | 2 +-
 tests/system/providers/apache/kafka/example_dag_hello_kafka.py    | 2 +-
 tests/system/providers/ftp/example_ftp.py                         | 2 +-
 tests/system/providers/google/cloud/compute/example_compute.py    | 2 +-
 .../system/providers/google/cloud/compute/example_compute_igm.py  | 2 +-
 .../system/providers/google/cloud/compute/example_compute_ssh.py  | 2 +-
 .../google/cloud/dataproc/example_dataproc_spark_deferrable.py    | 2 +-
 tests/ti_deps/deps/test_runnable_exec_date_dep.py                 | 8 ++++----
 10 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/jobs/test_backfill_job.py b/tests/jobs/test_backfill_job.py
index 6bd4a1ab55..a11b8d5688 100644
--- a/tests/jobs/test_backfill_job.py
+++ b/tests/jobs/test_backfill_job.py
@@ -2054,7 +2054,7 @@ class TestBackfillJob:
     def test_backfill_disable_retry(self, dag_maker, disable_retry, 
try_number, exception):
         with dag_maker(
             dag_id="test_disable_retry",
-            schedule_interval="@daily",
+            schedule="@daily",
             default_args={
                 "retries": 2,
                 "retry_delay": datetime.timedelta(seconds=3),
diff --git a/tests/providers/openlineage/extractors/test_bash_extractor.py 
b/tests/providers/openlineage/extractors/test_bash_extractor.py
index 9de86ea62c..0d7a786d9e 100644
--- a/tests/providers/openlineage/extractors/test_bash_extractor.py
+++ b/tests/providers/openlineage/extractors/test_bash_extractor.py
@@ -33,7 +33,7 @@ from tests.test_utils.config import conf_vars
 with DAG(
     dag_id="test_dummy_dag",
     description="Test dummy DAG",
-    schedule_interval="*/2 * * * *",
+    schedule="*/2 * * * *",
     start_date=datetime(2020, 1, 8),
     catchup=False,
     max_active_runs=1,
diff --git a/tests/providers/openlineage/extractors/test_python_extractor.py 
b/tests/providers/openlineage/extractors/test_python_extractor.py
index fcff97a5fb..08c29cb90c 100644
--- a/tests/providers/openlineage/extractors/test_python_extractor.py
+++ b/tests/providers/openlineage/extractors/test_python_extractor.py
@@ -35,7 +35,7 @@ from tests.test_utils.config import conf_vars
 dag = DAG(
     dag_id="test_dummy_dag",
     description="Test dummy DAG",
-    schedule_interval="*/2 * * * *",
+    schedule="*/2 * * * *",
     start_date=datetime(2020, 1, 8),
     catchup=False,
     max_active_runs=1,
diff --git a/tests/system/providers/apache/kafka/example_dag_hello_kafka.py 
b/tests/system/providers/apache/kafka/example_dag_hello_kafka.py
index 4bc2b44451..57e67ac81a 100644
--- a/tests/system/providers/apache/kafka/example_dag_hello_kafka.py
+++ b/tests/system/providers/apache/kafka/example_dag_hello_kafka.py
@@ -151,7 +151,7 @@ with DAG(
     "kafka-example",
     default_args=default_args,
     description="Examples of Kafka Operators",
-    schedule_interval=timedelta(days=1),
+    schedule=timedelta(days=1),
     start_date=datetime(2021, 1, 1),
     catchup=False,
     tags=["example"],
diff --git a/tests/system/providers/ftp/example_ftp.py 
b/tests/system/providers/ftp/example_ftp.py
index a1dbeae509..cfecccf61c 100644
--- a/tests/system/providers/ftp/example_ftp.py
+++ b/tests/system/providers/ftp/example_ftp.py
@@ -34,7 +34,7 @@ DAG_ID = "example_ftp_ftps_put_get"
 
 with DAG(
     DAG_ID,
-    schedule_interval="@once",
+    schedule="@once",
     start_date=datetime(2021, 1, 1),
     catchup=False,
     tags=["example", "Ftp", "FtpFileTransmit", "Ftps", "FtpsFileTransmit"],
diff --git a/tests/system/providers/google/cloud/compute/example_compute.py 
b/tests/system/providers/google/cloud/compute/example_compute.py
index d5fbf347c0..13e25ae794 100644
--- a/tests/system/providers/google/cloud/compute/example_compute.py
+++ b/tests/system/providers/google/cloud/compute/example_compute.py
@@ -100,7 +100,7 @@ GCE_INSTANCE_FROM_TEMPLATE_BODY = {
 
 with models.DAG(
     DAG_ID,
-    schedule_interval="@once",
+    schedule="@once",
     start_date=datetime(2021, 1, 1),
     catchup=False,
     tags=["example"],
diff --git a/tests/system/providers/google/cloud/compute/example_compute_igm.py 
b/tests/system/providers/google/cloud/compute/example_compute_igm.py
index 13ada15044..45449cf125 100644
--- a/tests/system/providers/google/cloud/compute/example_compute_igm.py
+++ b/tests/system/providers/google/cloud/compute/example_compute_igm.py
@@ -110,7 +110,7 @@ UPDATE_POLICY = {
 
 with models.DAG(
     DAG_ID,
-    schedule_interval="@once",
+    schedule="@once",
     start_date=datetime(2021, 1, 1),
     catchup=False,
     tags=["example"],
diff --git a/tests/system/providers/google/cloud/compute/example_compute_ssh.py 
b/tests/system/providers/google/cloud/compute/example_compute_ssh.py
index deaa1ad873..532cabc374 100644
--- a/tests/system/providers/google/cloud/compute/example_compute_ssh.py
+++ b/tests/system/providers/google/cloud/compute/example_compute_ssh.py
@@ -71,7 +71,7 @@ GCE_INSTANCE_BODY = {
 
 with models.DAG(
     DAG_ID,
-    schedule_interval="@once",
+    schedule="@once",
     start_date=datetime(2021, 1, 1),
     catchup=False,
     tags=["example", "compute-ssh"],
diff --git 
a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py
 
b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py
index 738f5269f8..599eb4cf27 100644
--- 
a/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py
+++ 
b/tests/system/providers/google/cloud/dataproc/example_dataproc_spark_deferrable.py
@@ -68,7 +68,7 @@ SPARK_JOB = {
 
 with models.DAG(
     DAG_ID,
-    schedule_interval="@once",
+    schedule="@once",
     start_date=datetime(2021, 1, 1),
     catchup=False,
     tags=["example", "dataproc", "spark", "deferrable"],
diff --git a/tests/ti_deps/deps/test_runnable_exec_date_dep.py 
b/tests/ti_deps/deps/test_runnable_exec_date_dep.py
index 4df559e489..210a8ddbb3 100644
--- a/tests/ti_deps/deps/test_runnable_exec_date_dep.py
+++ b/tests/ti_deps/deps/test_runnable_exec_date_dep.py
@@ -38,7 +38,7 @@ def clean_db(session):
 
 @time_machine.travel("2016-11-01")
 @pytest.mark.parametrize(
-    "allow_trigger_in_future,schedule_interval,execution_date,is_met",
+    "allow_trigger_in_future,schedule,execution_date,is_met",
     [
         (True, None, datetime(2016, 11, 3), True),
         (True, "@daily", datetime(2016, 11, 3), False),
@@ -53,12 +53,12 @@ def test_exec_date_dep(
     session,
     create_dummy_dag,
     allow_trigger_in_future,
-    schedule_interval,
+    schedule,
     execution_date,
     is_met,
 ):
     """
-    If the dag's execution date is in the future but 
(allow_trigger_in_future=False or not schedule_interval)
+    If the dag's execution date is in the future but 
(allow_trigger_in_future=False or not schedule)
     this dep should fail
     """
     with patch.object(settings, "ALLOW_FUTURE_EXEC_DATES", 
allow_trigger_in_future):
@@ -66,7 +66,7 @@ def test_exec_date_dep(
             "test_localtaskjob_heartbeat",
             start_date=datetime(2015, 1, 1),
             end_date=datetime(2016, 11, 5),
-            schedule=schedule_interval,
+            schedule=schedule,
             with_dagrun_type=DagRunType.MANUAL,
             session=session,
         )

Reply via email to