Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use airflow.datasets.Dataset in examples and tests #34605

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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