Skip to content

Fix Issue 48466 #62

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

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
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: 6 additions & 0 deletions CHANGE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
LabKey Python Client API News
+++++++++++

What's New in the LabKey 2.6.1 package
==============================

*Release date: 10/09/2023*
- Query API - Change max_rows default value to -1 in select_rows

What's New in the LabKey 2.6.0 package
==============================

Expand Down
2 changes: 1 addition & 1 deletion labkey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
# limitations under the License.
#
__title__ = "labkey"
__version__ = "2.6.0"
__version__ = "2.6.1"
__author__ = "LabKey"
__license__ = "Apache License 2.0"
6 changes: 3 additions & 3 deletions labkey/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def select_rows(
filter_array: List[QueryFilter] = None,
container_path: str = None,
columns=None,
max_rows: int = None,
max_rows: int = -1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Down on line 376, should it be if max_rows is not -1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seperately, should the @functools.wraps part down on line 525 be updated to -1 as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 376 - No, it needs to remain that way or we'll never pass the default value.
For 525 - Yes, good catch.

sort: str = None,
offset: int = None,
container_filter: str = None,
Expand All @@ -339,7 +339,7 @@ def select_rows(
:param filter_array: set of filter objects to apply
:param container_path: folder path if not already part of server_context
:param columns: set of columns to retrieve
:param max_rows: max number of rows to retrieve
:param max_rows: max number of rows to retrieve, defaults to -1 (unlimited)
:param sort: comma separated list of column names to sort by, prefix a column with '-' to sort descending
:param offset: number of rows to offset results by
:param container_filter: enumeration of the various container filters available. See:
Expand Down Expand Up @@ -522,7 +522,7 @@ def select_rows(
filter_array: List[QueryFilter] = None,
container_path: str = None,
columns=None,
max_rows: int = None,
max_rows: int = -1,
sort: str = None,
offset: int = None,
container_filter: str = None,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_query_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def setUp(self):
self.service = MockSelectRows()
self.expected_kwargs = {
"expected_args": [self.service.get_server_url()],
"data": {"schemaName": schema, "query.queryName": query},
"data": {"schemaName": schema, "query.queryName": query, "query.maxRows": -1},
"headers": None,
"timeout": 300,
}
Expand Down