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
781d7729
Unverified
Commit
781d7729
authored
1 year ago
by
Case Nelson
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[MLv2] Add remaining aggregation js wrappers (#31206)
parent
831b5329
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/lib/js.cljs
+24
-0
24 additions, 0 deletions
src/metabase/lib/js.cljs
with
24 additions
and
0 deletions
src/metabase/lib/js.cljs
+
24
−
0
View file @
781d7729
...
...
@@ -323,6 +323,30 @@
unit
(
if
(
string?
unit
)
(
keyword
unit
)
unit
)]
(
lib.core/describe-relative-datetime
n
unit
)))
(
defn
^
:export
aggregate
"Adds an aggregation to query."
([
a-query
an-aggregate-clause
]
(
aggregate
a-query
-1
an-aggregate-clause
))
([
a-query
stage-number
an-aggregate-clause
]
(
lib.core/aggregate
a-query
stage-number
an-aggregate-clause
)))
(
defn
^
:export
aggregations
"Get the aggregations in a given stage of a query."
([
a-query
]
(
aggregations
a-query
-1
))
([
a-query
stage-number
]
(
to-array
(
lib.core/aggregations
a-query
stage-number
))))
(
defn
^
:export
aggregation-clause
"Returns a standalone aggregation clause for an `aggregation-operator` and
a `column`.
For aggregations requiring an argument `column` is mandatory, otherwise
it is optional."
([
aggregation-operator
]
(
lib.core/aggregation-clause
aggregation-operator
))
([
aggregation-operator
column
]
(
lib.core/aggregation-clause
aggregation-operator
column
)))
(
defn
^
:export
available-aggregation-operators
"Get the available aggregation operators for the stage with `stage-number` of
the query `a-query`.
...
...
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