Skip to content

Commit 25efabc

Browse files
authored
fix: show slot_millis_sum warning only when allow_large_results=False (#1892)
1 parent 1395a50 commit 25efabc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

bigframes/session/__init__.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,15 @@ def bytes_processed_sum(self):
339339
@property
340340
def slot_millis_sum(self):
341341
"""The sum of all slot time used by bigquery jobs in this session."""
342-
msg = bfe.format_message(
343-
"Queries executed with `allow_large_results=False` within the session will not "
344-
"have their slot milliseconds counted in this sum. If you need precise slot "
345-
"milliseconds information, query the `INFORMATION_SCHEMA` tables "
346-
"to get relevant metrics.",
347-
)
348-
warnings.warn(msg, UserWarning)
342+
if not bigframes.options._allow_large_results:
343+
msg = bfe.format_message(
344+
"Queries executed with `allow_large_results=False` within the session will not "
345+
"have their slot milliseconds counted in this sum. If you need precise slot "
346+
"milliseconds information, query the `INFORMATION_SCHEMA` tables "
347+
"to get relevant metrics.",
348+
)
349+
warnings.warn(msg, UserWarning)
350+
349351
return self._metrics.slot_millis
350352

351353
@property

0 commit comments

Comments
 (0)