From 9a17a3274b27b7a9384e168b9281584f00138fdc Mon Sep 17 00:00:00 2001 From: Paul Borgermans Date: Fri, 18 Apr 2025 14:10:57 +0200 Subject: [PATCH] Implement env variable for altering the default query limit in genquery --- irods/query.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/irods/query.py b/irods/query.py index 3f890c79..9587b82f 100644 --- a/irods/query.py +++ b/irods/query.py @@ -1,3 +1,5 @@ +import os + from collections import OrderedDict from irods import MAX_SQL_ROWS @@ -34,7 +36,7 @@ "SELECT_COUNT": 6, } - +IRODS_QUERY_LIMIT = os.getenv("IRODS_QUERY_LIMIT", 500) class Query: def __init__(self, sess, *args, **kwargs): @@ -194,7 +196,7 @@ def _kw_message(self): return StringStringMap(dct) def _message(self): - max_rows = 500 if self._limit == -1 else self._limit + max_rows = IRODS_QUERY_LIMIT if self._limit == -1 else self._limit args = { "maxRows": max_rows, "continueInx": self._continue_index,