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
fd8865a8
Unverified
Commit
fd8865a8
authored
3 years ago
by
Howon Lee
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cache ttls nillable now (#17852)
parent
1a29ab8b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/metabase/api/card.clj
+2
-2
2 additions, 2 deletions
src/metabase/api/card.clj
src/metabase/api/dashboard.clj
+2
-2
2 additions, 2 deletions
src/metabase/api/dashboard.clj
test/metabase/api/card_test.clj
+9
-2
9 additions, 2 deletions
test/metabase/api/card_test.clj
with
13 additions
and
6 deletions
src/metabase/api/card.clj
+
2
−
2
View file @
fd8865a8
...
...
@@ -429,9 +429,9 @@
;; `collection_id` and `description` can be `nil` (in order to unset them). Other values should only be
;; modified if they're passed in as non-nil
(
u/select-keys-when
card-updates
:present
#
{
:collection_id
:collection_position
:description
}
:present
#
{
:collection_id
:collection_position
:description
:cache_ttl
}
:non-nil
#
{
:dataset_query
:display
:name
:visualization_settings
:archived
:enable_embedding
:embedding_params
:result_metadata
:cache_ttl
})))
:embedding_params
:result_metadata
})))
;; Fetch the updated Card from the DB
(
let
[
card
(
Card
id
)]
(
delete-alerts-if-needed!
card-before-update
card
)
...
...
This diff is collapsed.
Click to expand it.
src/metabase/api/dashboard.clj
+
2
−
2
View file @
fd8865a8
...
...
@@ -301,9 +301,9 @@
;; description, position, collection_id, and collection_position are allowed to be `nil`.
;; Everything else must be non-nil
(
u/select-keys-when
dash-updates
:present
#
{
:description
:position
:collection_id
:collection_position
}
:present
#
{
:description
:position
:collection_id
:collection_position
:cache_ttl
}
:non-nil
#
{
:name
:parameters
:caveats
:points_of_interest
:show_in_getting_started
:enable_embedding
:embedding_params
:archived
:cache_ttl
})))))
:embedding_params
:archived
})))))
;; now publish an event and return the updated Dashboard
(
let
[
dashboard
(
Dashboard
id
)]
(
events/publish-event!
:dashboard-update
(
assoc
dashboard
:actor_id
api/*current-user-id*
))
...
...
This diff is collapsed.
Click to expand it.
test/metabase/api/card_test.clj
+
9
−
2
View file @
fd8865a8
...
...
@@ -409,8 +409,15 @@
:put
202
(
str
"card/"
(
u/the-id
card
))
{
:cache_ttl
1234
}))))))))
{
:cache_ttl
1234
}))))))
(
testing
"nilling out cache ttl works"
(
mt/with-temp
Card
[
card
]
(
is
(
=
nil
(
do
(
mt/user-http-request
:rasta
:put
202
(
str
"card/"
(
u/the-id
card
))
{
:cache_ttl
1234
})
(
mt/user-http-request
:rasta
:put
202
(
str
"card/"
(
u/the-id
card
))
{
:cache_ttl
nil
})
(
:cache_ttl
(
mt/user-http-request
:rasta
:get
200
(
str
"card/"
(
u/the-id
card
))))
)))))))
(
defn-
fingerprint-integers->doubles
"Converts the min/max fingerprint values to doubles so simulate how the FE will change the metadata when POSTing a
...
...
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