Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
731b8f5d
Commit
731b8f5d
authored
7 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Keep QP schema validation exception sizes reasonable
parent
131bdc4d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/query_processor/middleware/catch_exceptions.clj
+1
-1
1 addition, 1 deletion
src/metabase/query_processor/middleware/catch_exceptions.clj
test/metabase/query_processor/expand_resolve_test.clj
+20
-4
20 additions, 4 deletions
test/metabase/query_processor/expand_resolve_test.clj
with
21 additions
and
5 deletions
src/metabase/query_processor/middleware/catch_exceptions.clj
+
1
−
1
View file @
731b8f5d
...
...
@@ -23,7 +23,7 @@
(
dissoc
:database
:driver
)
u/ignore-exceptions
))}
(
when-let
[
data
(
ex-data
e
)]
{
:ex-data
data
})
{
:ex-data
(
dissoc
data
:schema
)
})
additional-info
))
(
defn-
explain-schema-validation-error
...
...
This diff is collapsed.
Click to expand it.
test/metabase/query_processor/expand_resolve_test.clj
+
20
−
4
View file @
731b8f5d
(
ns
metabase.query-processor.expand-resolve-test
"Tests query expansion/resolution"
(
:require
[
expectations
:refer
:all
]
(
:require
[
clojure.string
:as
str
]
[
expectations
:refer
:all
]
[
metabase
[
query-processor
:as
qp
]
[
util
:as
u
]]
[
metabase.query-processor.middleware
[
expand
:as
ql
]
[
resolve
:as
resolve
]
[
source-table
:as
source-table
]]
[
metabase.test
[
data
:refer
:all
]
[
data
:as
data
:refer
:all
]
[
util
:as
tu
]]
[
metabase.test.data.dataset-definitions
:as
defs
]
[
metabase.util
:as
u
]))
[
metabase.test.data.dataset-definitions
:as
defs
]))
;; this is here because expectations has issues comparing and object w/ a map and most of the output
;; below has objects for the various place holders in the expanded/resolved query
...
...
@@ -321,3 +324,16 @@
(
tu/boolean-ids-and-timestamps
(
mapv
obj->map
[
expanded-form
(
resolve
'
expanded-form
)]))))
;; check that a schema invalidation error produces a reasonably-sized exception, < 50 lines.
;; previously the entire schema was being dumped which resulted in a ~5200 line exception (#5978)
(
expect
(
->
(
qp/process-query
{
:database
(
data/id
)
:type
:query
:query
{
:source-table
(
data/id
:venues
)
:filter
[
:and
nil
]}})
u/pprint-to-str
str/split-lines
count
(
<
50
)))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment