Skip to content
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

ENG-4490: Setting default value for query param '_limit'. #72

Merged
merged 2 commits into from
Feb 20, 2024
Merged
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
25 changes: 23 additions & 2 deletions smsdk/client_v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,13 @@ def inner(
machine[0], return_mtype=True
)

if not "_limit" in kwargs:
print("_limit not specified. Maximum of 5000 rows will be returned.")
if "_limit" not in kwargs:
print("_limit not specified. Maximum of 5000 rows will be returned.")
kwargs["_limit"] = 5000
JMkrish marked this conversation as resolved.
Show resolved Hide resolved
elif kwargs["_limit"] > 5000:
print(
"Warning: _limit over 5000 specified. Setting excessively large limits may lead to timeouts."
)

if not "_only" in kwargs:
print("_only not specified. Selecting first 50 fields.")
Expand Down Expand Up @@ -402,6 +407,14 @@ def inner(
if args and (not kwargs):
kwargs = args[0]

if "_limit" not in kwargs:
print("_limit not specified. Maximum of 5000 rows will be returned.")
kwargs["_limit"] = 5000
elif kwargs["_limit"] > 5000:
print(
"Warning: _limit over 5000 specified. Setting excessively large limits may lead to timeouts."
)

if not "_only" in kwargs:
kwargs["_only"] = downmap.keys()

Expand Down Expand Up @@ -464,6 +477,14 @@ def inner(
kwargs["type__part_type"] = part
part_schema = self.get_part_schema(part)

if "_limit" not in kwargs:
print("_limit not specified. Maximum of 5000 rows will be returned.")
kwargs["_limit"] = 5000
elif kwargs["_limit"] > 5000:
print(
"Warning: _limit over 5000 specified. Setting excessively large limits may lead to timeouts."
)

if "_only" not in kwargs:
print("_only not specified. Selecting first 50 fields.")

Expand Down