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

Fix Airflow 2.10 regression and Add Airflow 2.10 in test matrix #1162

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: test

on:
push: # Run on pushes to the default branch
branches: [main]
branches: [main, test-af-2.10]
pankajastro marked this conversation as resolved.
Show resolved Hide resolved
pull_request_target: # Also run on pull requests originated from forks
branches: [main]

Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9"]
airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10"]
exclude:
- python-version: "3.11"
airflow-version: "2.4"
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9"]
airflow-version: ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10"]
exclude:
- python-version: "3.11"
airflow-version: "2.4"
Expand Down
24 changes: 24 additions & 0 deletions cosmos/operators/aws_eks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,18 @@
DbtAwsEksBaseOperator.template_fields + DbtBuildKubernetesOperator.template_fields # type: ignore[operator]
)

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtLSAwsEksOperator(DbtAwsEksBaseOperator, DbtLSKubernetesOperator):
"""
Executes a dbt core ls command.
"""

def __init__(self, **kwargs: Any) -> None:
pankajastro marked this conversation as resolved.
Show resolved Hide resolved
super().__init__(**kwargs)


class DbtSeedAwsEksOperator(DbtAwsEksBaseOperator, DbtSeedKubernetesOperator):
"""
Expand All @@ -95,18 +101,27 @@
DbtAwsEksBaseOperator.template_fields + DbtSeedKubernetesOperator.template_fields # type: ignore[operator]
)

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSnapshotAwsEksOperator(DbtAwsEksBaseOperator, DbtSnapshotKubernetesOperator):
"""
Executes a dbt core snapshot command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 114 in cosmos/operators/aws_eks.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/aws_eks.py#L114

Added line #L114 was not covered by tests


class DbtSourceAzureContainerInstanceOperator(DbtAwsEksBaseOperator, DbtSourceKubernetesOperator):
"""
Executes a dbt source freshness command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 123 in cosmos/operators/aws_eks.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/aws_eks.py#L123

Added line #L123 was not covered by tests


class DbtRunAwsEksOperator(DbtAwsEksBaseOperator, DbtRunKubernetesOperator):
"""
Expand All @@ -117,6 +132,9 @@
DbtAwsEksBaseOperator.template_fields + DbtRunKubernetesOperator.template_fields # type: ignore[operator]
)

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtTestAwsEksOperator(DbtAwsEksBaseOperator, DbtTestKubernetesOperator):
"""
Expand All @@ -127,6 +145,9 @@
DbtAwsEksBaseOperator.template_fields + DbtTestKubernetesOperator.template_fields # type: ignore[operator]
)

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtRunOperationAwsEksOperator(DbtAwsEksBaseOperator, DbtRunOperationKubernetesOperator):
"""
Expand All @@ -136,3 +157,6 @@
template_fields: Sequence[str] = (
DbtAwsEksBaseOperator.template_fields + DbtRunOperationKubernetesOperator.template_fields # type: ignore[operator]
)

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 162 in cosmos/operators/aws_eks.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/aws_eks.py#L162

Added line #L162 was not covered by tests
24 changes: 22 additions & 2 deletions cosmos/operators/azure_container_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
Executes a dbt core ls command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSeedAzureContainerInstanceOperator(DbtSeedMixin, DbtAzureContainerInstanceBaseOperator): # type: ignore
"""
Expand All @@ -92,19 +95,28 @@

template_fields: Sequence[str] = DbtAzureContainerInstanceBaseOperator.template_fields + DbtRunMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSnapshotAzureContainerInstanceOperator(DbtSnapshotMixin, DbtAzureContainerInstanceBaseOperator): # type: ignore
"""
Executes a dbt core snapshot command.

"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 109 in cosmos/operators/azure_container_instance.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/azure_container_instance.py#L109

Added line #L109 was not covered by tests


class DbtSourceAzureContainerInstanceOperator(DbtSourceMixin, DbtAzureContainerInstanceBaseOperator):
"""
Executes a dbt source freshness command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 118 in cosmos/operators/azure_container_instance.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/azure_container_instance.py#L118

Added line #L118 was not covered by tests


class DbtRunAzureContainerInstanceOperator(DbtRunMixin, DbtAzureContainerInstanceBaseOperator): # type: ignore
"""
Expand All @@ -113,6 +125,9 @@

template_fields: Sequence[str] = DbtAzureContainerInstanceBaseOperator.template_fields + DbtRunMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtTestAzureContainerInstanceOperator(DbtTestMixin, DbtAzureContainerInstanceBaseOperator): # type: ignore
"""
Expand All @@ -125,7 +140,7 @@
self.on_warning_callback = on_warning_callback


class DbtRunOperationAzureContainerInstanceOperator(DbtRunOperationMixin, DbtAzureContainerInstanceBaseOperator): # type: ignore
class DbtRunOperationAzureContainerInstanceOperator(DbtRunOperationMixin, DbtAzureContainerInstanceBaseOperator):
"""
Executes a dbt core run-operation command.

Expand All @@ -134,4 +149,9 @@
selected macro.
"""

template_fields: Sequence[str] = DbtAzureContainerInstanceBaseOperator.template_fields + DbtRunOperationMixin.template_fields # type: ignore[operator]
template_fields: Sequence[str] = (
DbtAzureContainerInstanceBaseOperator.template_fields + DbtRunOperationMixin.template_fields # type: ignore[operator]
)

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 157 in cosmos/operators/azure_container_instance.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/azure_container_instance.py#L157

Added line #L157 was not covered by tests
21 changes: 21 additions & 0 deletions cosmos/operators/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@

template_fields: Sequence[str] = DbtDockerBaseOperator.template_fields + DbtBuildMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtLSDockerOperator(DbtLSMixin, DbtDockerBaseOperator):
"""
Executes a dbt core ls command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSeedDockerOperator(DbtSeedMixin, DbtDockerBaseOperator):
"""
Expand All @@ -85,18 +91,27 @@

template_fields: Sequence[str] = DbtDockerBaseOperator.template_fields + DbtSeedMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSnapshotDockerOperator(DbtSnapshotMixin, DbtDockerBaseOperator):
"""
Executes a dbt core snapshot command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 104 in cosmos/operators/docker.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/docker.py#L104

Added line #L104 was not covered by tests


class DbtSourceDockerOperator(DbtSourceMixin, DbtDockerBaseOperator):
"""
Executes a dbt source freshness command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 113 in cosmos/operators/docker.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/docker.py#L113

Added line #L113 was not covered by tests


class DbtRunDockerOperator(DbtRunMixin, DbtDockerBaseOperator):
"""
Expand All @@ -105,6 +120,9 @@

template_fields: Sequence[str] = DbtDockerBaseOperator.template_fields + DbtRunMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtTestDockerOperator(DbtTestMixin, DbtDockerBaseOperator):
"""
Expand All @@ -127,3 +145,6 @@
"""

template_fields: Sequence[str] = DbtDockerBaseOperator.template_fields + DbtRunOperationMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 150 in cosmos/operators/docker.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/docker.py#L150

Added line #L150 was not covered by tests
21 changes: 21 additions & 0 deletions cosmos/operators/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,18 @@

template_fields: Sequence[str] = DbtKubernetesBaseOperator.template_fields + DbtBuildMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtLSKubernetesOperator(DbtLSMixin, DbtKubernetesBaseOperator):
"""
Executes a dbt core ls command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSeedKubernetesOperator(DbtSeedMixin, DbtKubernetesBaseOperator):
"""
Expand All @@ -116,18 +122,27 @@

template_fields: Sequence[str] = DbtKubernetesBaseOperator.template_fields + DbtSeedMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSnapshotKubernetesOperator(DbtSnapshotMixin, DbtKubernetesBaseOperator):
"""
Executes a dbt core snapshot command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 135 in cosmos/operators/kubernetes.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/kubernetes.py#L135

Added line #L135 was not covered by tests


class DbtSourceKubernetesOperator(DbtSourceMixin, DbtKubernetesBaseOperator):
"""
Executes a dbt source freshness command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 144 in cosmos/operators/kubernetes.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/kubernetes.py#L144

Added line #L144 was not covered by tests


class DbtRunKubernetesOperator(DbtRunMixin, DbtKubernetesBaseOperator):
"""
Expand All @@ -136,6 +151,9 @@

template_fields: Sequence[str] = DbtKubernetesBaseOperator.template_fields + DbtRunMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtTestKubernetesOperator(DbtTestMixin, DbtKubernetesBaseOperator):
"""
Expand Down Expand Up @@ -239,3 +257,6 @@
"""

template_fields: Sequence[str] = DbtKubernetesBaseOperator.template_fields + DbtRunOperationMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

Check warning on line 262 in cosmos/operators/kubernetes.py

View check run for this annotation

Codecov / codecov/patch

cosmos/operators/kubernetes.py#L262

Added line #L262 was not covered by tests
21 changes: 21 additions & 0 deletions cosmos/operators/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,18 @@ class DbtBuildLocalOperator(DbtBuildMixin, DbtLocalBaseOperator):

template_fields: Sequence[str] = DbtLocalBaseOperator.template_fields + DbtBuildMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtLSLocalOperator(DbtLSMixin, DbtLocalBaseOperator):
"""
Executes a dbt core ls command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSeedLocalOperator(DbtSeedMixin, DbtLocalBaseOperator):
"""
Expand All @@ -559,18 +565,27 @@ class DbtSeedLocalOperator(DbtSeedMixin, DbtLocalBaseOperator):

template_fields: Sequence[str] = DbtLocalBaseOperator.template_fields + DbtSeedMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSnapshotLocalOperator(DbtSnapshotMixin, DbtLocalBaseOperator):
"""
Executes a dbt core snapshot command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtSourceLocalOperator(DbtSourceMixin, DbtLocalBaseOperator):
"""
Executes a dbt source freshness command.
"""

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtRunLocalOperator(DbtRunMixin, DbtLocalBaseOperator):
"""
Expand All @@ -579,6 +594,9 @@ class DbtRunLocalOperator(DbtRunMixin, DbtLocalBaseOperator):

template_fields: Sequence[str] = DbtLocalBaseOperator.template_fields + DbtRunMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtTestLocalOperator(DbtTestMixin, DbtLocalBaseOperator):
"""
Expand Down Expand Up @@ -641,6 +659,9 @@ class DbtRunOperationLocalOperator(DbtRunOperationMixin, DbtLocalBaseOperator):

template_fields: Sequence[str] = DbtLocalBaseOperator.template_fields + DbtRunOperationMixin.template_fields # type: ignore[operator]

def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)


class DbtDocsLocalOperator(DbtLocalBaseOperator):
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pre-install-commands = ["sh scripts/test/pre-install-airflow.sh {matrix:airflow}

[[tool.hatch.envs.tests.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
airflow = ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9"]
airflow = ["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10"]

[tool.hatch.envs.tests.overrides]
matrix.airflow.dependencies = [
Expand Down
Loading