0.5.5 causing Maximum number of tokens exceeded in DBT queries #829
Replies: 2 comments
-
|
Hi, I also share pain with this token limit. It would be great if this was something we could override with a parameter. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for bringing this up! It shows me, that the recent change in 0.5.5 (issue #827) was correct. 0.5.4 introduced this token and recursion tracking to avoid DoS attacks. Unfortunately instead of raising an exception it returned The reason is a security-first approach: If you have a valid use-case where you know the statements that are processed by sqlparse it's perfectly fine to disable these constraints (the old behavior before 0.5.4). But if you "just use" sqlparse these constraints cover you from DoS attacks. The change is documented here: https://sqlparse.readthedocs.io/en/latest/api.html#security-and-performance-considerations TL;DR: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
It seems that DBT core has a dependency on this library, and the latest version 0.5.5 causes some issues with DBT. Specifically larger queries cause the error:
Maximum number of tokens exceeded {number}I suspect it's this commit:
da67ac1
I realize this is more of a DBT issue than this library, but wanted to give a heads up.
To Reproduce
Using dbt 1.8 or higher, it pulls in this library as dependency.
Not exactly sure, but a fairly large query (sorry I don't have an exact reproducible one I can share)
The limit seemed relatively low.
Expected behavior
Success, these are valid queries that previously had worked.
Aside: terminology of 'tokens' while likely correct gets confusing LLMs being so common these days.
Versions (please complete the following information):
Additional context
Related DBT issue: dbt-labs/dbt-core#12303
Beta Was this translation helpful? Give feedback.
All reactions