Skip to content

Implement env variable for altering the default query limit in genquery #712 #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions irods/query.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from collections import OrderedDict

from irods import MAX_SQL_ROWS
Expand Down Expand Up @@ -34,7 +36,7 @@
"SELECT_COUNT": 6,
}


IRODS_QUERY_LIMIT = os.getenv("IRODS_QUERY_LIMIT", 500)
class Query:

def __init__(self, sess, *args, **kwargs):
Expand Down Expand Up @@ -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,
Expand Down