Skip to content

Commit

Permalink
Use airflow.datasets.Dataset in examples and tests (apache#34605)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taragolis authored Sep 25, 2023
1 parent d0ae60f commit 5ac1e7c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion airflow/example_dags/example_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

import pendulum

from airflow import DAG, Dataset
from airflow.datasets import Dataset
from airflow.models.dag import DAG
from airflow.operators.bash import BashOperator

# [START dataset_def]
Expand Down
3 changes: 2 additions & 1 deletion tests/dags/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

from datetime import datetime

from airflow import DAG, Dataset
from airflow.datasets import Dataset
from airflow.exceptions import AirflowFailException, AirflowSkipException
from airflow.models.dag import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator

Expand Down
3 changes: 2 additions & 1 deletion tests/dags/test_only_empty_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
from datetime import datetime
from typing import Sequence

from airflow import DAG, Dataset
from airflow.datasets import Dataset
from airflow.models.dag import DAG
from airflow.operators.empty import EmptyOperator

DEFAULT_DATE = datetime(2016, 1, 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/decorators/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def other(x):


def test_task_decorator_dataset(dag_maker, session):
from airflow import Dataset
from airflow.datasets import Dataset

result = None
uri = "s3://test"
Expand Down
6 changes: 4 additions & 2 deletions tests/models/test_serialized_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
import pendulum
import pytest

from airflow import DAG, Dataset, example_dags as example_dags_module
from airflow.models import DagBag
import airflow.example_dags as example_dags_module
from airflow.datasets import Dataset
from airflow.models.dag import DAG
from airflow.models.dagbag import DagBag
from airflow.models.dagcode import DagCode
from airflow.models.serialized_dag import SerializedDagModel as SDM
from airflow.operators.bash import BashOperator
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ def test_changing_of_dataset_when_ddrq_is_already_populated(self, dag_maker, ses
Test that when a task that produces dataset has ran, that changing the consumer
dag dataset will not cause primary key blank-out
"""
from airflow import Dataset
from airflow.datasets import Dataset

with dag_maker(schedule=None, serialized=True) as dag1:

Expand Down
2 changes: 1 addition & 1 deletion tests/www/views/test_views_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import pytest
from dateutil.tz import UTC

from airflow import Dataset
from airflow.datasets import Dataset
from airflow.models.dataset import DatasetEvent, DatasetModel
from airflow.operators.empty import EmptyOperator
from tests.test_utils.asserts import assert_queries_count
Expand Down

0 comments on commit 5ac1e7c

Please sign in to comment.