amaannawab923 commented on code in PR #33357:
URL: https://github.com/apache/superset/pull/33357#discussion_r2079177918


##########
superset/utils/core.py:
##########
@@ -1741,24 +1741,29 @@ def parse_boolean_string(bool_str: str | None) -> bool:
 
 def apply_max_row_limit(
     limit: int,
-    max_limit: int | None = None,
+    server_pagination: bool = False,
 ) -> int:
     """
-    Override row limit if max global limit is defined
+    Override row limit based on server pagination setting
 
     :param limit: requested row limit
-    :param max_limit: Maximum allowed row limit
+    :param server_pagination: whether server-side pagination is enabled
     :return: Capped row limit
 
-    >>> apply_max_row_limit(100000, 10)
-    10
-    >>> apply_max_row_limit(10, 100000)
-    10
-    >>> apply_max_row_limit(0, 10000)
-    10000
-    """
-    if max_limit is None:

Review Comment:
   Because the function is no where using the max_limit from anywhere... I can 
add it again ... i only removed it because the argument wasn't getting used
   
   Usages 
   
   superset/viz.py
   row_limit = apply_max_row_limit(row_limit). # No second arg for max_limit
   
   superset/datasource/api.py
   row_limit = apply_max_row_limit(app.config["FILTER_SELECT_ROW_LIMIT"]) # No 
second arg for max_limit
   
   superset/sqllab/sqllab_execution_context.py
   limit = apply_max_row_limit(query_params.get("queryLimit") or 0) # No second 
arg for max_limit
   



##########
superset/utils/core.py:
##########
@@ -1741,24 +1741,29 @@ def parse_boolean_string(bool_str: str | None) -> bool:
 
 def apply_max_row_limit(
     limit: int,
-    max_limit: int | None = None,
+    server_pagination: bool = False,

Review Comment:
   Sure



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to