Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Update Airflow filtered warnings, address deprecations (#3591)
Madison Swain-Bowdenf5387f16d50f
diff --git a/catalog/dags/common/ingestion_server.py b/catalog/dags/common/ingestion_server.pyindex 2edb8731e..e8ba9f4c4 100644--- a/catalog/dags/common/ingestion_server.py+++ b/catalog/dags/common/ingestion_server.py@@ -6,7 +6,7 @@ from urllib.parse import urlparsefrom airflow.decorators import taskfrom airflow.exceptions import AirflowSkipException-from airflow.providers.http.operators.http import SimpleHttpOperator+from airflow.providers.http.operators.http import HttpOperatorfrom airflow.providers.http.sensors.http import HttpSensorfrom requests import Response@@ -95,8 +95,8 @@ def generate_index_suffix(default_suffix: str | None = None) -> str:def get_current_index(target_alias: str, http_conn_id: str = "data_refresh"-) -> SimpleHttpOperator:- return SimpleHttpOperator(+) -> HttpOperator:+ return HttpOperator(task_id="get_current_index",http_conn_id=http_conn_id,endpoint=f"stat/{target_alias}",@@ -111,13 +111,13 @@ def trigger_task(model: str,data: dict | None = None,http_conn_id: str = "data_refresh",-) -> SimpleHttpOperator:+) -> HttpOperator:data = {**(data or {}),"model": model,"action": action.upper(),}- return SimpleHttpOperator(+ return HttpOperator(task_id=f"trigger_{action.lower()}",http_conn_id=http_conn_id,endpoint="task",@@ -129,7 +129,7 @@ def trigger_task(def wait_for_task(action: str,- task_trigger: SimpleHttpOperator,+ task_trigger: HttpOperator,timeout: timedelta,poke_interval: int = REFRESH_POKE_INTERVAL,http_conn_id: str = "data_refresh",@@ -153,7 +153,7 @@ def trigger_and_wait_for_task(data: dict | None = None,poke_interval: int = REFRESH_POKE_INTERVAL,http_conn_id: str = "data_refresh",-) -> tuple[SimpleHttpOperator, HttpSensor]:+) -> tuple[HttpOperator, HttpSensor]:trigger = trigger_task(action, model, data, http_conn_id)waiter = wait_for_task(action, trigger, timeout, poke_interval, http_conn_id)trigger >> waiterdiff --git a/catalog/env.template b/catalog/env.templateindex b3b8ac028..8e94e2471 100644--- a/catalog/env.template+++ b/catalog/env.template@@ -106,6 +106,9 @@ AIRFLOW_VAR_CATCHUP_ENABLED=false# Number of records to expect in a healthy ES index. Used during the data refresh to verify that# a new index is healthy before promoting.ES_INDEX_READINESS_RECORD_COUNT=1000+# Warning in dependency, nothing we can do+# https://docs.sqlalchemy.org/en/20/errors.html#error-b8d9+SQLALCHEMY_SILENCE_UBER_WARNING=1AIRFLOW_VAR_AIRFLOW_RDS_ARN=unsetAIRFLOW_VAR_AIRFLOW_RDS_SNAPSHOTS_TO_RETAIN=7diff --git a/catalog/pytest.ini b/catalog/pytest.iniindex 96cafe324..feb607347 100644--- a/catalog/pytest.ini+++ b/catalog/pytest.ini@@ -18,11 +18,6 @@ addopts =--disable-socket--allow-unix-socket-# sqlalchemy-# Warning in dependency, nothing we can do-# https://docs.sqlalchemy.org/en/20/errors.html#error-b8d9-# airflow-# Warning within Airflow for an internal call, nothing we can do# flask# https://docs.sqlalchemy.org/en/20/errors.html#error-b8d9# Warning in dependency, nothing we can do@@ -30,8 +25,6 @@ addopts =# distutils# Warning in dependency, nothing we can dofilterwarnings=- ignore::sqlalchemy.exc.MovedIn20Warning- ignore:Calling `DAG.create_dagrun\(\)` without an explicit data interval is deprecated:airflow.exceptions.RemovedInAirflow3Warningignore:.*is deprecated and will be (remoevd|removed) in Flask 2.3.:DeprecationWarningignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning