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
dfb293b8
Commit
dfb293b8
authored
6 years ago
by
Simon Belak
Browse files
Options
Downloads
Patches
Plain Diff
Nil pad results of last-n when (count seq) < n
parent
ce03bfa2
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/sync/analyze/fingerprint/insights.clj
+2
-1
2 additions, 1 deletion
src/metabase/sync/analyze/fingerprint/insights.clj
test/metabase/sync/analyze/fingerprint/insights_test.clj
+12
-0
12 additions, 0 deletions
test/metabase/sync/analyze/fingerprint/insights_test.clj
with
14 additions
and
1 deletion
src/metabase/sync/analyze/fingerprint/insights.clj
+
2
−
1
View file @
dfb293b8
...
...
@@ -11,7 +11,8 @@
[
n
]
(
fn
([]
[])
([
acc
]
acc
)
([
acc
]
(
concat
(
repeat
(
-
n
(
count
acc
))
nil
)
acc
))
([
acc
x
]
(
if
(
<
(
count
acc
)
n
)
(
conj
acc
x
)
...
...
This diff is collapsed.
Click to expand it.
test/metabase/sync/analyze/fingerprint/insights_test.clj
+
12
−
0
View file @
dfb293b8
...
...
@@ -15,9 +15,21 @@
first
:last-value
))
(
expect
700
(
->
(
transduce
identity
(
insights
cols
)
[[
"2017"
700
]])
first
:last-value
))
;; Here we just make sure we don't blow up on empty input
(
expect
nil
(
->
(
transduce
identity
(
insights
cols
)
[])
first
:last-value
))
(
expect
nil
(
->
(
transduce
identity
(
insights
cols
)
[[
nil
nil
]])
first
:last-value
))
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