Skip to content

Commit 75a684a

Browse files
committed
fixing tests
2 parents 0fa2477 + f8453ba commit 75a684a

File tree

423 files changed

+5668
-801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+5668
-801
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ indent_size = 2
4040
[*.ts]
4141
indent_size = 2
4242

43+
[*.tsx]
44+
indent_size = 2
45+
4346
[*.css]
4447
indent_size = 2
4548

.github/boring-cyborg.yml

+9-34
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ labelPRBasedOnFilePath:
3434
- providers/apache/beam/**
3535

3636
provider:apache-cassandra:
37-
- providers/src/airflow/providers/apache/cassandra/**/*
38-
- docs/apache-airflow-providers-apache-cassandra/**/*
39-
- providers/tests/apache/cassandra/**/*
40-
- providers/tests/system/apache/cassandra/**/*
37+
- providers/apache/cassandra/**
4138

4239
provider:apache-drill:
4340
- providers/src/airflow/providers/apache/drill/**/*
@@ -82,10 +79,7 @@ labelPRBasedOnFilePath:
8279
- providers/apache/kylin/**
8380

8481
provider:apache-livy:
85-
- providers/src/airflow/providers/apache/livy/**/*
86-
- docs/apache-airflow-providers-apache-livy/**/*
87-
- providers/tests/apache/livy/**/*
88-
- providers/tests/system/apache/livy/**/*
82+
- providers/apache/livy/**
8983

9084
provider:apache-pig:
9185
- providers/apache/pig/**
@@ -97,9 +91,7 @@ labelPRBasedOnFilePath:
9791
- providers/apache/spark/**
9892

9993
provider:apprise:
100-
- providers/src/airflow/providers/apprise/**/*
101-
- docs/apache-airflow-providers-apprise/**/*
102-
- providers/tests/apprise/**/*
94+
- providers/apprise/**
10395

10496
provider:arangodb:
10597
- providers/src/airflow/providers/arangodb/**/*
@@ -110,9 +102,7 @@ labelPRBasedOnFilePath:
110102
- providers/asana/**
111103

112104
provider:atlassian-jira:
113-
- providers/src/airflow/providers/atlassian/jira/**/*
114-
- docs/apache-airflow-providers-atlassian-jira/**/*
115-
- providers/tests/atlassian/jira/**/*
105+
- providers/atlassian/jira/**
116106

117107
provider:celery:
118108
- providers/celery/**
@@ -172,10 +162,7 @@ labelPRBasedOnFilePath:
172162
- providers/discord/**
173163

174164
provider:docker:
175-
- providers/src/airflow/providers/docker/**/*
176-
- docs/apache-airflow-providers-docker/**/*
177-
- providers/tests/docker/**/*
178-
- providers/tests/system/docker/**/*
165+
- providers/docker/**
179166

180167
provider:edge:
181168
- providers/edge/**
@@ -198,10 +185,7 @@ labelPRBasedOnFilePath:
198185
- providers/facebook/**
199186

200187
provider:ftp:
201-
- providers/src/airflow/providers/ftp/**/*
202-
- docs/apache-airflow-providers-ftp/**/*
203-
- providers/tests/ftp/**/*
204-
- providers/tests/system/ftp/**/*
188+
- providers/ftp/**
205189

206190
provider:github:
207191
- providers/src/airflow/providers/github/**/*
@@ -230,10 +214,7 @@ labelPRBasedOnFilePath:
230214
- providers/imap/**
231215

232216
provider:influxdb:
233-
- providers/src/airflow/providers/influxdb/**/*
234-
- docs/apache-airflow-providers-influxdb/**/*
235-
- providers/tests/influxdb/**/*
236-
- providers/tests/system/influxdb/**/*
217+
- providers/influxdb/**
237218

238219
provider:jdbc:
239220
- providers/src/airflow/providers/jdbc/**/*
@@ -350,10 +331,7 @@ labelPRBasedOnFilePath:
350331
- providers/singularity/**
351332

352333
provider:slack:
353-
- providers/src/airflow/providers/slack/**/*
354-
- docs/apache-airflow-providers-slack/**/*
355-
- providers/tests/slack/**/*
356-
- providers/tests/system/slack/**/*
334+
- providers/slack/**
357335

358336
provider:smtp:
359337
- providers/src/airflow/providers/smtp/**/*
@@ -382,10 +360,7 @@ labelPRBasedOnFilePath:
382360
- providers/teradata/**
383361

384362
provider:trino:
385-
- providers/src/airflow/providers/trino/**/*
386-
- docs/apache-airflow-providers-trino/**/*
387-
- providers/tests/trino/**/*
388-
- providers/tests/system/trino/**/*
363+
- providers/trino/**
389364

390365
provider:vertica:
391366
- providers/vertica/**

.github/workflows/basic-tests.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- run: uv tool run --from apache-airflow-breeze pytest -n auto --color=yes
8686
working-directory: ./dev/breeze/
8787
tests-ui:
88-
timeout-minutes: 10
88+
timeout-minutes: 15
8989
name: React UI tests
9090
runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }}
9191
if: inputs.run-ui-tests == 'true'
@@ -115,7 +115,7 @@ jobs:
115115
with:
116116
path: airflow/ui/node_modules/
117117
key: cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
118-
id: restore-eslint-cache
118+
id: restore-eslint-cache-ui
119119
- run: cd airflow/ui && pnpm install --frozen-lockfile
120120
- run: cd airflow/ui && pnpm test
121121
env:
@@ -127,7 +127,29 @@ jobs:
127127
key: cache-ui-node-modules-v1-${{ runner.os }}-${{ hashFiles('airflow/ui/**/pnpm-lock.yaml') }}
128128
if-no-files-found: 'error'
129129
retention-days: '2'
130-
if: steps.restore-eslint-cache.outputs.stash-hit != 'true'
130+
if: steps.restore-eslint-cache-ui.outputs.stash-hit != 'true'
131+
- name: "Restore eslint cache (simple auth manager UI)"
132+
uses: apache/infrastructure-actions/stash/restore@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
133+
with:
134+
path: airflow/auth/managers/simple/ui/node_modules/
135+
key: >
136+
cache-simple-am-ui-node-modules-v1-
137+
${{ runner.os }}-${{ hashFiles('airflow/auth/managers/simple/ui/**/pnpm-lock.yaml') }}
138+
id: restore-eslint-cache-simple-am-ui
139+
- run: cd airflow/auth/managers/simple/ui && pnpm install --frozen-lockfile
140+
- run: cd airflow/auth/managers/simple/ui && pnpm test
141+
env:
142+
FORCE_COLOR: 2
143+
- name: "Save eslint cache (ui)"
144+
uses: apache/infrastructure-actions/stash/save@1c35b5ccf8fba5d4c3fdf25a045ca91aa0cbc468
145+
with:
146+
path: airflow/auth/managers/simple/ui/node_modules/
147+
key: >
148+
cache-simple-am-ui-node-modules-v1-
149+
${{ runner.os }}-${{ hashFiles('airflow/auth/managers/simple/ui/**/pnpm-lock.yaml') }}
150+
if-no-files-found: 'error'
151+
retention-days: '2'
152+
if: steps.restore-eslint-cache-simple-am-ui.outputs.stash-hit != 'true'
131153

132154
tests-www:
133155
timeout-minutes: 10

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ repos:
627627
^providers/src/airflow/providers/fab/www/static/css/bootstrap-theme.css$|
628628
^providers/src/airflow/providers/amazon/aws/hooks/emr.py$|
629629
^providers/src/airflow/providers/amazon/aws/operators/emr.py$|
630-
^providers/src/airflow/providers/apache/cassandra/hooks/cassandra.py$|
630+
^providers/apache/cassandra/src/airflow/providers/apache/cassandra/hooks/cassandra.py$|
631631
^providers/src/airflow/providers/apache/hive/operators/hive_stats.py$|
632632
^providers/src/airflow/providers/apache/hive/transfers/vertica_to_hive.py$|
633633
^providers/apache/spark/src/airflow/providers/apache/spark/decorators/|

Dockerfile.ci

+1-8
Original file line numberDiff line numberDiff line change
@@ -935,17 +935,10 @@ function check_boto_upgrade() {
935935
# We need to include few dependencies to pass pip check with other dependencies:
936936
# * oss2 as dependency as otherwise jmespath will be bumped (sync with alibaba provider)
937937
# * cryptography is kept for snowflake-connector-python limitation (sync with snowflake provider)
938-
# * requests needs to be limited to be compatible with apache beam (sync with apache-beam provider)
939-
# * yandexcloud requirements for requests does not match those of apache.beam and latest botocore
940-
# Both requests and yandexcloud exclusion above might be removed after
941-
# https://github.com/apache/beam/issues/32080 is addressed
942-
# This is already addressed and planned for 2.59.0 release.
943-
# When you remove yandexcloud and opensearch from the above list, you can also remove the
944-
# optional providers_dependencies exclusions from "test_example_dags.py" in "tests/always".
945938
set -x
946939
# shellcheck disable=SC2086
947940
${PACKAGING_TOOL_CMD} install ${EXTRA_INSTALL_FLAGS} --upgrade boto3 botocore \
948-
"oss2>=2.14.0" "cryptography<43.0.0" "requests!=2.32.*,<3.0.0,>=2.24.0"
941+
"oss2>=2.14.0" "cryptography<43.0.0" "opensearch-py"
949942
set +x
950943
pip check
951944
}

airflow/api_fastapi/core_api/base.py

+12
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,15 @@ class BaseModel(PydanticBaseModel):
2727
"""
2828

2929
model_config = ConfigDict(from_attributes=True, populate_by_name=True)
30+
31+
32+
class StrictBaseModel(BaseModel):
33+
"""
34+
StrictBaseModel is a base Pydantic model for REST API that does not allow any extra fields.
35+
36+
Use this class for models that should not have any extra fields in the payload.
37+
38+
:meta private:
39+
"""
40+
41+
model_config = ConfigDict(from_attributes=True, populate_by_name=True, extra="forbid")

airflow/api_fastapi/core_api/datamodels/assets.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121

2222
from pydantic import Field, field_validator
2323

24-
from airflow.api_fastapi.core_api.base import BaseModel
24+
from airflow.api_fastapi.core_api.base import BaseModel, StrictBaseModel
2525
from airflow.utils.log.secrets_masker import redact
2626

2727

28-
class DagScheduleAssetReference(BaseModel):
28+
class DagScheduleAssetReference(StrictBaseModel):
2929
"""DAG schedule reference serializer for assets."""
3030

3131
dag_id: str
3232
created_at: datetime
3333
updated_at: datetime
3434

3535

36-
class TaskOutletAssetReference(BaseModel):
36+
class TaskOutletAssetReference(StrictBaseModel):
3737
"""Task outlet reference serializer for assets."""
3838

3939
dag_id: str
@@ -84,7 +84,7 @@ class AssetAliasCollectionResponse(BaseModel):
8484
total_entries: int
8585

8686

87-
class DagRunAssetReference(BaseModel):
87+
class DagRunAssetReference(StrictBaseModel):
8888
"""DAGRun serializer for asset responses."""
8989

9090
run_id: str
@@ -141,7 +141,7 @@ class QueuedEventCollectionResponse(BaseModel):
141141
total_entries: int
142142

143143

144-
class CreateAssetEventsBody(BaseModel):
144+
class CreateAssetEventsBody(StrictBaseModel):
145145
"""Create asset events request."""
146146

147147
asset_id: int

airflow/api_fastapi/core_api/datamodels/backfills.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
from datetime import datetime
2121

22-
from airflow.api_fastapi.core_api.base import BaseModel
22+
from airflow.api_fastapi.core_api.base import BaseModel, StrictBaseModel
2323
from airflow.models.backfill import ReprocessBehavior
2424

2525

26-
class BackfillPostBody(BaseModel):
26+
class BackfillPostBody(StrictBaseModel):
2727
"""Object used for create backfill request."""
2828

2929
dag_id: str

airflow/api_fastapi/core_api/datamodels/common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
from pydantic import Discriminator, Field, Tag
2929

30-
from airflow.api_fastapi.core_api.base import BaseModel
30+
from airflow.api_fastapi.core_api.base import BaseModel, StrictBaseModel
3131

3232
# Common Bulk Data Models
3333
T = TypeVar("T")
@@ -57,7 +57,7 @@ class BulkActionNotOnExistence(enum.Enum):
5757
SKIP = "skip"
5858

5959

60-
class BulkBaseAction(BaseModel, Generic[T]):
60+
class BulkBaseAction(StrictBaseModel, Generic[T]):
6161
"""Base class for bulk actions."""
6262

6363
action: BulkAction = Field(..., description="The action to be performed on the entities.")
@@ -88,7 +88,7 @@ def _action_discriminator(action: Any) -> str:
8888
return BulkAction(action["action"]).value
8989

9090

91-
class BulkBody(BaseModel, Generic[T]):
91+
class BulkBody(StrictBaseModel, Generic[T]):
9292
"""Serializer for bulk entity operations."""
9393

9494
actions: list[

airflow/api_fastapi/core_api/datamodels/config.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# under the License.
1717
from __future__ import annotations
1818

19-
from airflow.api_fastapi.core_api.base import BaseModel
19+
from airflow.api_fastapi.core_api.base import StrictBaseModel
2020

2121

22-
class ConfigOption(BaseModel):
22+
class ConfigOption(StrictBaseModel):
2323
"""Config option."""
2424

2525
key: str
@@ -32,7 +32,7 @@ def text_format(self):
3232
return f"{self.key} = {self.value}"
3333

3434

35-
class ConfigSection(BaseModel):
35+
class ConfigSection(StrictBaseModel):
3636
"""Config Section Schema."""
3737

3838
name: str
@@ -53,7 +53,7 @@ def text_format(self):
5353
return f"[{self.name}]\n" + "\n".join(option.text_format for option in self.options) + "\n"
5454

5555

56-
class Config(BaseModel):
56+
class Config(StrictBaseModel):
5757
"""List of config sections with their options."""
5858

5959
sections: list[ConfigSection]

airflow/api_fastapi/core_api/datamodels/connections.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from pydantic import Field, field_validator
2323
from pydantic_core.core_schema import ValidationInfo
2424

25-
from airflow.api_fastapi.core_api.base import BaseModel
25+
from airflow.api_fastapi.core_api.base import BaseModel, StrictBaseModel
2626
from airflow.utils.log.secrets_masker import redact
2727

2828

@@ -76,7 +76,7 @@ class ConnectionTestResponse(BaseModel):
7676

7777

7878
# Request Models
79-
class ConnectionBody(BaseModel):
79+
class ConnectionBody(StrictBaseModel):
8080
"""Connection Serializer for requests body."""
8181

8282
connection_id: str = Field(serialization_alias="conn_id", max_length=200, pattern=r"^[\w.-]+$")

airflow/api_fastapi/core_api/datamodels/dag_run.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from pydantic import AwareDatetime, Field, NonNegativeInt, computed_field, model_validator
2424

25-
from airflow.api_fastapi.core_api.base import BaseModel
25+
from airflow.api_fastapi.core_api.base import BaseModel, StrictBaseModel
2626
from airflow.models import DagRun
2727
from airflow.utils import timezone
2828
from airflow.utils.state import DagRunState
@@ -37,14 +37,14 @@ class DAGRunPatchStates(str, Enum):
3737
FAILED = DagRunState.FAILED
3838

3939

40-
class DAGRunPatchBody(BaseModel):
40+
class DAGRunPatchBody(StrictBaseModel):
4141
"""DAG Run Serializer for PATCH requests."""
4242

4343
state: DAGRunPatchStates | None = None
4444
note: str | None = Field(None, max_length=1000)
4545

4646

47-
class DAGRunClearBody(BaseModel):
47+
class DAGRunClearBody(StrictBaseModel):
4848
"""DAG Run serializer for clear endpoint body."""
4949

5050
dry_run: bool = True
@@ -78,7 +78,7 @@ class DAGRunCollectionResponse(BaseModel):
7878
total_entries: int
7979

8080

81-
class TriggerDAGRunPostBody(BaseModel):
81+
class TriggerDAGRunPostBody(StrictBaseModel):
8282
"""Trigger DAG Run Serializer for POST body."""
8383

8484
dag_run_id: str | None = None
@@ -109,7 +109,7 @@ def logical_date(self) -> datetime:
109109
return timezone.utcnow()
110110

111111

112-
class DAGRunsBatchBody(BaseModel):
112+
class DAGRunsBatchBody(StrictBaseModel):
113113
"""List DAG Runs body for batch endpoint."""
114114

115115
order_by: str | None = None

0 commit comments

Comments
 (0)