Skip to content

Commit 7660e6d

Browse files
authored
fix: bypass pagination in download_results to prevent truncated exports (#1096) (#1097)
1 parent 0a6ce20 commit 7660e6d

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

insights/insights/doctype/insights_data_source_v3/ibis_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,13 +776,14 @@ def execute_ibis_query(
776776
query: IbisQuery,
777777
page=1,
778778
page_size=100,
779+
paginate=True,
779780
force=False,
780781
cache=True,
781782
cache_expiry=3600,
782783
reference_doctype=None,
783784
reference_name=None,
784785
):
785-
if hasattr(query, "limit"):
786+
if paginate and hasattr(query, "limit"):
786787
page_size = clamp(page_size, 1, 10_000)
787788
page = clamp(page, 1, 10_000)
788789
offset = (page - 1) * page_size

insights/insights/doctype/insights_query_v3/insights_query_v3.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,13 @@ def download_results(
238238
if decimal_casts:
239239
ibis_query = ibis_query.mutate(**decimal_casts)
240240

241+
if hasattr(ibis_query, "limit"):
242+
ibis_query = ibis_query.limit(100_000)
243+
241244
results, _ = execute_ibis_query(
242245
ibis_query,
243246
cache=False,
244-
page_size=10_00_000,
247+
paginate=False,
245248
reference_doctype=self.doctype,
246249
reference_name=self.name,
247250
)

0 commit comments

Comments
 (0)