Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Update Airflow to 2.11.1 (#5640)
Konstantin Obenlandfae50b00bf65
diff --git a/catalog/dags/common/sql.py b/catalog/dags/common/sql.pyindex 33d8fac0f..e95d5b194 100644--- a/catalog/dags/common/sql.py+++ b/catalog/dags/common/sql.py@@ -5,7 +5,7 @@ from airflow.decorators import taskfrom airflow.models import BaseOperatorfrom airflow.models.abstractoperator import AbstractOperatorfrom airflow.models.mappedoperator import MappedOperator-from airflow.providers.common.sql.hooks.sql import fetch_one_handler+from airflow.providers.common.sql.hooks.handlers import fetch_one_handlerfrom airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperatorfrom airflow.providers.postgres.hooks.postgres import (PostgresHook as UpstreamPostgresHook,diff --git a/catalog/dags/data_refresh/alter_data.py b/catalog/dags/data_refresh/alter_data.pyindex 1a9481da4..b7ee52aeb 100644--- a/catalog/dags/data_refresh/alter_data.py+++ b/catalog/dags/data_refresh/alter_data.py@@ -12,7 +12,10 @@ from textwrap import dedentfrom airflow.decorators import task, task_groupfrom airflow.models.abstractoperator import AbstractOperator-from airflow.providers.common.sql.hooks.sql import fetch_all_handler, fetch_one_handler+from airflow.providers.common.sql.hooks.handlers import (+ fetch_all_handler,+ fetch_one_handler,+)from psycopg2.extras import Jsonfrom common.constants import POSTGRES_API_CONN_IDS, Environmentdiff --git a/catalog/dags/data_refresh/distributed_reindex.py b/catalog/dags/data_refresh/distributed_reindex.pyindex 031a367df..fbd41ad47 100644--- a/catalog/dags/data_refresh/distributed_reindex.py+++ b/catalog/dags/data_refresh/distributed_reindex.py@@ -16,7 +16,7 @@ from airflow.exceptions import AirflowSkipExceptionfrom airflow.models.connection import Connectionfrom airflow.operators.empty import EmptyOperatorfrom airflow.providers.amazon.aws.hooks.ec2 import EC2Hook-from airflow.providers.common.sql.hooks.sql import fetch_one_handler+from airflow.providers.common.sql.hooks.handlers import fetch_one_handlerfrom airflow.sensors.base import PokeReturnValuefrom airflow.utils.trigger_rule import TriggerRulefrom requests import Responsediff --git a/catalog/env.template b/catalog/env.templateindex 9ddc0861e..3122145d3 100644--- a/catalog/env.template+++ b/catalog/env.template@@ -19,6 +19,9 @@ AIRFLOW__CORE__HIDE_SENSITIVE_VAR_CONN_FIELDS=FalseAIRFLOW__WEBSERVER__SECRET_KEY=sample-secret-key=# Executor to useAIRFLOW__CORE__EXECUTOR=LocalExecutor+# Publish timer metrics in milliseconds, the Airflow 3 default. Airflow 2.11 warns+# on import until this is set, and the test suite treats that warning as an error.+AIRFLOW__METRICS__TIMER_UNIT_CONSISTENCY=True# Environment this instance is being run inAIRFLOW_VAR_ENVIRONMENT=localdiff --git a/catalog/pytest.ini b/catalog/pytest.iniindex ddf36bfee..f52d59455 100644--- a/catalog/pytest.ini+++ b/catalog/pytest.ini@@ -43,7 +43,7 @@ addopts =filterwarnings=error::DeprecationWarningerror::airflow.exceptions.RemovedInAirflow3Warning- ignore:.*is deprecated and will be (remoevd|removed) in Flask 2.3.:DeprecationWarning+ ignore:.*is deprecated and will be (remoevd|removed) in Flask 2.[0-9].:DeprecationWarningignore:datetime.datetime.utcnow:DeprecationWarning:botocoreignore::DeprecationWarning:marshmallow.*ignore:Importing from the 'elasticsearch.client' module is deprecated:DeprecationWarning:airflow.providers.elasticsearch.hooks.elasticsearchdiff --git a/catalog/requirements-prod.txt b/catalog/requirements-prod.txtindex 6d22689cb..578620dbd 100644--- a/catalog/requirements-prod.txt+++ b/catalog/requirements-prod.txt@@ -2,12 +2,12 @@# Note: Unpinned packages have their versions determined by the Airflow constraints file-apache-airflow[amazon,postgres,http,elasticsearch]==2.10.4+apache-airflow[amazon,postgres,http,elasticsearch]==2.11.1backoff==2.2.1lxmlpsycopg2-binaryrequests-filerequests-oauthlib-smart-open[s3]==7.1.0+smart-open[s3]==7.5.0tabulate==0.9.0tldextract==5.3.2diff --git a/catalog/tests/conftest.py b/catalog/tests/conftest.pyindex 43bb28526..c9f0c6a6e 100644--- a/catalog/tests/conftest.py+++ b/catalog/tests/conftest.py@@ -1,3 +1,6 @@+# Registers the FAB `ab_user` table that `task_instance_note` references; without it,+# deleting task instances fails to resolve the foreign key.+import airflow.providers.fab.auth_manager.models # noqa: F401import pytestfrom airflow.models import DagRun, Pool, TaskInstancefrom airflow.utils.session import create_sessiondiff --git a/catalog/tests/dags/common/test_ingestion_server.py b/catalog/tests/dags/common/test_ingestion_server.pyindex 1f28e9adf..fac34b665 100644--- a/catalog/tests/dags/common/test_ingestion_server.py+++ b/catalog/tests/dags/common/test_ingestion_server.py@@ -84,9 +84,7 @@ def test_index_readiness_check(run_type=DagRunType.MANUAL,)- with mock.patch(- "airflow.providers.http.hooks.http.requests.Session.send"- ) as mock_session_send:+ with mock.patch("requests.Session.send") as mock_session_send:r = requests.Response()r.status_code = response_coder.reason = "test"