Skip to content

Commit 952661c

Browse files
authored
Merge branch 'main' into user-impersonation-reworked
2 parents c014ebe + 683deb6 commit 952661c

File tree

7 files changed

+184
-14
lines changed

7 files changed

+184
-14
lines changed

airflow-core/src/airflow/ui/src/i18n/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import heAdmin from "./locales/he/admin.json";
3838
import heAsset from "./locales/he/assets.json";
3939
import heBrowse from "./locales/he/browse.json";
4040
import heCommon from "./locales/he/common.json";
41+
import heComponents from "./locales/he/components.json";
4142
import heDashboard from "./locales/he/dashboard.json";
4243
import koCommon from "./locales/ko/common.json";
4344
import koDashboard from "./locales/ko/dashboard.json";
@@ -98,6 +99,7 @@ const resources = {
9899
assets: heAsset,
99100
browse: heBrowse,
100101
common: heCommon,
102+
components: heComponents,
101103
dashboard: heDashboard,
102104
},
103105
ko: {
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"backfill": {
3+
"affected_one": "ריצה אחת תופעל.",
4+
"affected_other": "{{count}} ריצות תופעלנה.",
5+
"affectedNone": "לא נמצאו ריצות התואמות לקריטריונים שנבחרו.",
6+
"backwards": "הרץ לאחור",
7+
"dateRange": "טווח תאריכים",
8+
"dateRangeFrom": "מתאריך",
9+
"dateRangeTo": "עד תאריך",
10+
"errorStartDateBeforeEndDate": "תאריך ההתחלה חייב להיות לפני תאריך הסיום",
11+
"maxRuns": "מספר ריצות מקבילות מירבי",
12+
"reprocessBehavior": "התנהגות עיבוד מחדש",
13+
"run": "הרץ Backfill",
14+
"selectDescription": "הרץ DAG זה עבור טווח תאריכים",
15+
"selectLabel": "Backfill",
16+
"title": "הרץ Backfill",
17+
"toaster": {
18+
"success": {
19+
"description": "משימות ה-Backfill הופעלו בהצלחה.",
20+
"title": "Backfill נוצר"
21+
}
22+
},
23+
"tooltip": "Backfill דורש לוח זמנים",
24+
"unpause": "הפעל את {{dag_display_name}} בעת ההרצה",
25+
"validation": {
26+
"datesRequired": "יש להזין גם תאריך התחלה וגם תאריך סיום של מרווח הנתונים.",
27+
"startBeforeEnd": "תאריך התחלת מרווח הנתונים חייב להיות קטן או שווה לתאריך סיום מרווח הנתונים."
28+
}
29+
},
30+
"banner": {
31+
"backfillInProgress": "Backfill בתהליך",
32+
"cancel": "בטל backfill",
33+
"pause": "השהה backfill",
34+
"unpause": "הפעל מחדש backfill"
35+
},
36+
"clipboard": {
37+
"copy": "העתק"
38+
},
39+
"close": "סגור",
40+
"configForm": {
41+
"advancedOptions": "אפשרויות מתקדמות",
42+
"configJson": "הגדרות JSON",
43+
"invalidJson": "מבנה ה-JSON אינו תקין: {{errorMessage}}"
44+
},
45+
"dagWarnings": {
46+
"error_one": "שגיאה אחת",
47+
"errorAndWarning": "שגיאה אחת ו-{{warningText}}",
48+
"warning_one": "אזהרה אחת",
49+
"warning_other": "{{count}} אזהרות"
50+
},
51+
"durationChart": {
52+
"duration": "משך זמן (שניות)",
53+
"lastDagRun_one": "ריצת DAG אחרונה",
54+
"lastDagRun_other": "{{count}} ריצות DAG אחרונות",
55+
"lastTaskInstance_one": "משימה אחרונה",
56+
"lastTaskInstance_other": "{{count}} משימות אחרונות",
57+
"queuedDuration": "זמן המתנה בתור",
58+
"runAfter": "הרץ אחרי",
59+
"runDuration": "משך זמן ריצה"
60+
},
61+
"fileUpload": {
62+
"files_other": "{{count}} קבצים"
63+
},
64+
"flexibleForm": {
65+
"placeholder": "בחר ערך",
66+
"placeholderArray": "הכנס כל מחרוזת בשורה חדשה",
67+
"placeholderExamples": "התחל להקליד כדי לראות אפשרויות",
68+
"placeholderMulti": "בחר ערך אחד או יותר",
69+
"validationErrorArrayNotArray": "הערך חייב להיות מערך.",
70+
"validationErrorArrayNotNumbers": "כל האיברים במערך חייבים להיות מספרים.",
71+
"validationErrorArrayNotObject": "כל האיברים במערך חייבים להיות אובייקטים.",
72+
"validationErrorRequired": "שדה זה הוא חובה"
73+
},
74+
"graph": {
75+
"directionDown": "מלמעלה למטה",
76+
"directionLeft": "מימין לשמאל",
77+
"directionRight": "משמאל לימין",
78+
"directionUp": "מלמטה למעלה",
79+
"downloadImage": "הורד תמונת גרף",
80+
"downloadImageError": "הורדת תמונת הגרף נכשלה.",
81+
"downloadImageErrorTitle": "ההורדה נכשלה",
82+
"otherDagRuns": "+ ריצות DAG נוספות",
83+
"taskCount_one": "משימה אחת",
84+
"taskCount_other": "{{count}} משימות",
85+
"taskGroup": "קבוצת משימות"
86+
},
87+
"limitedList": "+ {{count}} נוספים",
88+
"logs": {
89+
"file": "קובץ",
90+
"in": "ב",
91+
"line": "שורה"
92+
},
93+
"reparseDag": "נתח DAG מחדש",
94+
"sortedAscending": "ממוין בסדר עולה",
95+
"sortedDescending": "ממוין בסדר יורד",
96+
"sortedUnsorted": "לא ממוין",
97+
"taskTries": "ניסיונות משימה",
98+
"toggleCardView": "הצג תצוגת כרטיסים",
99+
"toggleTableView": "הצג תצוגת טבלה",
100+
"triggerDag": {
101+
"button": "הפעל",
102+
"loading": "טוען מידע DAG...",
103+
"loadingFailed": "טעינת מידע ה-DAG נכשלה. אנא נסו שוב.",
104+
"runIdHelp": "אופציונלי - ייווצר אוטומטית אם לא יסופק",
105+
"selectDescription": "הפעל ריצה בודדת של DAG זה",
106+
"selectLabel": "ריצה בודדת",
107+
"title": "הפעל DAG",
108+
"toaster": {
109+
"success": {
110+
"description": "ריצת ה-DAG הופעלה בהצלחה.",
111+
"title": "ריצת DAG הופעלה"
112+
}
113+
},
114+
"unpause": "הפעל את {{dagDisplayName}} בעת ההרצה"
115+
},
116+
"trimText": {
117+
"details": "פרטים",
118+
"empty": "ריק",
119+
"noContent": "אין תוכן זמין."
120+
},
121+
"versionDetails": {
122+
"bundleLink": "קישור לחבילה",
123+
"bundleName": "שם החבילה",
124+
"bundleVersion": "גרסת החבילה",
125+
"createdAt": "נוצר ב",
126+
"versionId": "מזהה גרסה"
127+
},
128+
"versionSelect": {
129+
"dagVersion": "גרסת DAG",
130+
"versionCode": "גרסה {{versionCode}}"
131+
}
132+
}

providers/databricks/tests/unit/databricks/operators/test_databricks_copy.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838

3939
def test_copy_with_files():
40+
import re
41+
4042
op = DatabricksCopyIntoOperator(
4143
file_location=COPY_FILE_LOCATION,
4244
file_format="JSON",
@@ -45,16 +47,16 @@ def test_copy_with_files():
4547
format_options={"dateFormat": "yyyy-MM-dd"},
4648
task_id=TASK_ID,
4749
)
48-
assert (
49-
op._create_sql_query()
50-
== f"""COPY INTO test
51-
FROM '{COPY_FILE_LOCATION}'
52-
FILEFORMAT = JSON
53-
FILES = ('file1','file2','file3')
54-
FORMAT_OPTIONS ('dateFormat' = 'yyyy-MM-dd')
55-
""".strip()
50+
sql = op._create_sql_query()
51+
expected_pattern = (
52+
rf"COPY INTO test\s+FROM '{COPY_FILE_LOCATION}'\s+"
53+
r"FILEFORMAT = JSON\s+"
54+
r"(FILES = (ARRAY\(|\())'file1','file2','file3'\)?\s+"
55+
r"FORMAT_OPTIONS \('dateFormat' = 'yyyy-MM-dd'\)"
5656
)
5757

58+
assert re.fullmatch(expected_pattern, sql.strip(), flags=re.MULTILINE)
59+
5860

5961
def test_copy_with_expression():
6062
expression = "col1, col2"

providers/http/src/airflow/providers/http/hooks/http.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_conn(
159159
connection = self.get_connection(self.http_conn_id)
160160
self._set_base_url(connection)
161161
session = self._configure_session_from_auth(session, connection)
162-
if connection.extra:
162+
if connection.extra or extra_options:
163163
session = self._configure_session_from_extra(session, connection, extra_options)
164164
session = self._configure_session_from_mount_adapters(session)
165165
if self.default_headers:
@@ -298,10 +298,10 @@ def run_and_check(
298298

299299
settings = session.merge_environment_settings(
300300
prepped_request.url,
301-
proxies=extra_options.get("proxies", {}),
302-
stream=extra_options.get("stream", False),
303-
verify=extra_options.get("verify"),
304-
cert=extra_options.get("cert"),
301+
proxies=session.proxies,
302+
stream=session.stream,
303+
verify=session.verify,
304+
cert=session.cert,
305305
)
306306

307307
# Send the request.

providers/http/tests/unit/http/hooks/test_http.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def aioresponse():
4848
yield async_response
4949

5050

51+
def get_airflow_dummy_connection(conn_id: str = "http_default"):
52+
return Connection(conn_id=conn_id, conn_type="http", host="test:8080/")
53+
54+
5155
def get_airflow_connection(conn_id: str = "http_default"):
5256
return Connection(conn_id=conn_id, conn_type="http", host="test:8080/", extra='{"bearer": "test"}')
5357

@@ -294,6 +298,31 @@ def test_post_request_do_not_raise_for_status_if_check_response_is_false(self, r
294298
resp = self.post_hook.run("v1/test", extra_options={"check_response": False})
295299
assert resp.status_code == 418
296300

301+
def test_post_request_raises_error_when_redirects_with_max_redirects_set_to_0(self, requests_mock):
302+
requests_mock.post(
303+
"http://test:8080/v1/test",
304+
status_code=302,
305+
headers={"Location": "http://test:8080/v1/redirected"},
306+
)
307+
308+
requests_mock.post(
309+
"http://test:8080/v1/redirected",
310+
status_code=200,
311+
text='{"message": "OK"}',
312+
)
313+
314+
with mock.patch(
315+
"airflow.hooks.base.BaseHook.get_connection", side_effect=get_airflow_dummy_connection
316+
):
317+
with pytest.raises(requests.exceptions.TooManyRedirects) as err:
318+
self.post_hook.run("v1/test", extra_options={"max_redirects": 0})
319+
320+
assert str(err.value) == "Exceeded 0 redirects."
321+
history = requests_mock.request_history
322+
assert len(history) == 1
323+
assert history[0].url == "http://test:8080/v1/test"
324+
assert history[0].method == "POST"
325+
297326
def test_post_request_do_not_raise_for_status_if_check_response_is_false_within_extra(
298327
self, requests_mock
299328
):

providers/http/tests/unit/http/operators/test_http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def test_pagination(
142142
a dictionary that override previous' call parameters.
143143
"""
144144
is_second_call: bool = False
145+
extra_options_verify = extra_options["verify"]
145146

146147
def pagination_function(response: Response) -> dict | None:
147148
"""Paginated function which returns None at the second call."""
@@ -175,7 +176,7 @@ def pagination_function(response: Response) -> dict | None:
175176
first_call = first_endpoint.request_history[0]
176177
assert first_call.headers.items() >= headers.items()
177178
assert first_call.body == RequestEncodingMixin._encode_params(data)
178-
assert first_call.verify is extra_options["verify"]
179+
assert first_call.verify == extra_options_verify
179180

180181
# Ensure the second - paginated - call is made with parameters merged from the pagination function
181182
second_call = second_endpoint.request_history[0]

providers/http/tests/unit/http/sensors/test_http.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ def __init__(self):
265265
self.response = requests.Response()
266266
self.response.status_code = 200
267267
self.response._content = "apache/airflow".encode("ascii", "ignore")
268+
self.proxies = None
269+
self.stream = None
270+
self.verify = False
271+
self.cert = None
268272

269273
def send(self, *args, **kwargs):
270274
return self.response

0 commit comments

Comments
 (0)