You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/02/28 14:28:31 UTC

[airflow] branch main updated: added warning log for max page limit exceeding api calls (#29788)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1f933dfe65 added warning log for max page limit exceeding api calls (#29788)
1f933dfe65 is described below

commit 1f933dfe659e8f141e5fedfde9931bc9e3a51e44
Author: Bowrna <ma...@gmail.com>
AuthorDate: Tue Feb 28 19:58:03 2023 +0530

    added warning log for max page limit exceeding api calls (#29788)
---
 airflow/api_connexion/parameters.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/airflow/api_connexion/parameters.py b/airflow/api_connexion/parameters.py
index 8064912d92..5f8c8ad360 100644
--- a/airflow/api_connexion/parameters.py
+++ b/airflow/api_connexion/parameters.py
@@ -16,6 +16,7 @@
 # under the License.
 from __future__ import annotations
 
+import logging
 from datetime import datetime
 from functools import wraps
 from typing import Any, Callable, Container, TypeVar, cast
@@ -28,6 +29,8 @@ from airflow.api_connexion.exceptions import BadRequest
 from airflow.configuration import conf
 from airflow.utils import timezone
 
+log = logging.getLogger(__name__)
+
 
 def validate_istimezone(value: datetime) -> None:
     """Validates that a datetime is not naive."""
@@ -64,6 +67,11 @@ def check_limit(value: int) -> int:
     fallback = conf.getint("api", "fallback_page_limit")
 
     if value > max_val:
+        log.warning(
+            "The limit param value %s passed in API exceeds the configured maximum page limit %s",
+            value,
+            max_val,
+        )
         return max_val
     if value == 0:
         return fallback