Skip to content

Commit 64225b3

Browse files
authored
only run sqlglot limit check when user sets a limit (#6530)
## 📝 Summary <!-- Provide a concise summary of what this pull request is addressing. If this PR fixes any issues, list them here by number (e.g., Fixes #123). --> We would unecessarily run sqlglot parse even when a default limit is not specified. This improves perf, and is less annoying for fresh notebooks (do not require multiple installation popups) ## 🔍 Description of Changes <!-- Detail the specific changes made in this pull request. Explain the problem addressed and how it was resolved. If applicable, provide before and after comparisons, screenshots, or any relevant details to help reviewers understand the changes easily. --> ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [ ] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected.
1 parent ea007de commit 64225b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

marimo/_sql/sql.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ def sql(
123123
if df is None:
124124
return None
125125

126-
has_limit = _query_includes_limit(query)
126+
has_limit = False
127127
try:
128128
default_result_limit = get_default_result_limit()
129+
if default_result_limit is not None:
130+
has_limit = _query_includes_limit(query)
129131
except OSError:
130132
default_result_limit = None
131133

0 commit comments

Comments
 (0)