Repository: metabase/metabase
Pull request #58662: Reflect include-current option in filter name
Author: login: metamben
Labels: name: backport
description: Automatically create PR on current release branch on merge
name: .Team/Querying
Created: 2025-05-29T17:54:57Z | Merged: 2025-05-30T23:35:46Z

Fixes #50139

### Description

As described in https://github.com/metabase/metabase/issues/50139#issuecomment-2919403328, add special formatting for intervals with `include-current` set to `true`.

Native English speaking reviewers, please check if the rendered text can be improved.

### How to verify

Check the repro steps in #50139 and see the new test cases.

### Demo

<img width="330" alt="image" src="https://github.com/user-attachments/assets/40733a11-b501-44fb-bd60-386f2b51c2b0" />

### Checklist

- [x] Tests have been added/updated to cover changes in this PR


Linked issue #50139: Default filter name does not respect `include-current` parameter
### Describe the bug

![Image](https://github.com/user-attachments/assets/4d18d526-a5dc-4f09-b370-bd557365db6f)


### To Reproduce

1. New > Question > Orders
2. Add filter > Created At > Last week

✅ Filter name is "Created At is **in the previous** week"

3. Edit filter and select "Include this week"

❌ Filter name is "Created At is **in the previous** week"

### Expected behavior

Filter name should be different when `include-current` is `true`.

TODO: confirm expected behavior with the product team.
Suggested name: "Created At is in **this or previous** week".

If input is "0 weeks" plus "include this week" then filter name should be "Created At is this week"

### Information about your Metabase installation

master, 17887dcd2ceb5d638271b430f2b8522cdd9b6f1b

### Severity

P2

Linked issue comments: user: login: metamben
created_at: 2025-05-29T11:57:11Z
body: @mngr, what's your take on this? Is this a bug or a feature request? What should be displayed?
author_association: CONTRIBUTOR
user: login: mngr
created_at: 2025-05-29T13:29:52Z
body: Looks like a bug, I would show the name as "Created At is in the previous or this week"
author_association: NONE

Diff:
diff --git a/e2e/test/scenarios/custom-column/custom-column.cy.spec.js b/e2e/test/scenarios/custom-column/custom-column.cy.spec.js
index 28984976aeeb..070ce01a6b36 100644
--- a/e2e/test/scenarios/custom-column/custom-column.cy.spec.js
+++ b/e2e/test/scenarios/custom-column/custom-column.cy.spec.js
@@ -636,7 +636,7 @@ describe("scenarios > question > custom column", () => {
 
     H.queryBuilderMain().findByText("MiscDate").should("be.visible");
     cy.findByTestId("qb-filters-panel")
-      .findByText("MiscDate is in the previous 30 years")
+      .findByText("MiscDate is in the previous 30 years or this year")
       .should("be.visible");
   });
 
diff --git a/e2e/test/scenarios/filters/filter-types.cy.spec.js b/e2e/test/scenarios/filters/filter-types.cy.spec.js
index 03446086a772..a4187dcb9399 100644
--- a/e2e/test/scenarios/filters/filter-types.cy.spec.js
+++ b/e2e/test/scenarios/filters/filter-types.cy.spec.js
@@ -371,7 +371,7 @@ const RELATIVE_DATE_CASES = [
     offset: "Previous",
     unit: "day",
     value: 1,
-    expectedDisplayName: "Created At is yesterday",
+    expectedDisplayName: "Created At is today or yesterday",
     includeCurrent: true,
   },
   {
@@ -396,7 +396,7 @@ const RELATIVE_DATE_CASES = [
     offset: "Previous",
     unit: "month",
     value: 1,
-    expectedDisplayName: "Created At is in the previous month",
+    expectedDisplayName: "Created At is in the previous month or this month",
     includeCurrent: true,
   },
   {
@@ -411,7 +411,8 @@ const RELATIVE_DATE_CASES = [
     offset: "Previous",
     unit: "quarters",
     value: 2,
-    expectedDisplayName: "Created At is in the previous 2 quarters",
+    expectedDisplayName:
+      "Created At is in the previous 2 quarters or this quarter",
     includeCurrent: true,
   },
 
@@ -421,7 +422,7 @@ const RELATIVE_DATE_CASES = [
     offset: "Next",
     unit: "hours",
     value: 6,
-    expectedDisplayName: "Created At is in the next 6 hours",
+    expectedDisplayName: "Created At is in the next 6 hours or this hour",
     includeCurrent: true,
   },
   {
diff --git a/e2e/test/scenarios/filters/filter.cy.spec.js b/e2e/test/scenarios/filters/filter.cy.spec.js
index 9cc604b62812..96cc721ab48b 100644
--- a/e2e/test/scenarios/filters/filter.cy.spec.js
+++ b/e2e/test/scenarios/filters/filter.cy.spec.js
@@ -504,7 +504,7 @@ describe("scenarios > question > filter", () => {
     });
 
     H.getNotebookStep("filter")
-      .findByText("Created At is in the previous 30 days")
+      .findByText("Created At is in the previous 30 days or today")
       .click();
 
     H.clauseStepPopover().within(() => {
@@ -516,7 +516,7 @@ describe("scenarios > question > filter", () => {
 
     // Back to GUI and "Include today" should be still checked
     H.getNotebookStep("filter")
-      .findByText("Created At is in the previous 30 days")
+      .findByText("Created At is in the previous 30 days or today")
       .click();
 
     H.popover()
diff --git a/e2e/test/scenarios/filters/time-series-chrome.cy.spec.ts b/e2e/test/scenarios/filters/time-series-chrome.cy.spec.ts
index 942a9aacf16f..a984fddc1207 100644
--- a/e2e/test/scenarios/filters/time-series-chrome.cy.spec.ts
+++ b/e2e/test/scenarios/filters/time-series-chrome.cy.spec.ts
@@ -101,7 +101,7 @@ describe("time-series chrome filter widget", () => {
       });
 
       cy.findByTestId("filter-pill")
-        .should("have.text", "Created At is in the previous 30 days")
+        .should("have.text", "Created At is in the previous 30 days or today")
         .click();
 
       cy.log(
@@ -166,10 +166,10 @@ describe("time-series chrome filter widget", () => {
 
       cy.findByTestId("filter-pill").should(
         "have.text",
-        "Created At is in the next 30 years",
+        "Created At is in the next 30 years or this year",
       );
       cy.findByTestId("timeseries-filter-button")
-        .should("have.text", "Next 30 years")
+        .should("have.text", "Next 30 years or this year")
         .click();
     });
 
diff --git a/src/metabase/lib/fe_util.cljc b/src/metabase/lib/fe_util.cljc
index 2c55689997f4..c8ecb885d94a 100644
--- a/src/metabase/lib/fe_util.cljc
+++ b/src/metabase/lib/fe_util.cljc
@@ -784,8 +784,8 @@
       [:not-null & _]
       (i18n/tru "Is Not Empty")
 
-      [:time-interval _ (x :guard temporal?) n unit]
-      (lib.temporal-bucket/describe-temporal-interval n unit)
+      [:time-interval opts (x :guard temporal?) n unit]
+      (lib.temporal-bucket/describe-temporal-interval n unit opts)
 
       [:relative-time-interval _ (x :guard temporal?) n unit offset offset-unit]
       (lib.temporal-bucket/describe-temporal-interval-with-offset n unit offset offset-unit)
diff --git a/src/metabase/lib/filter.cljc b/src/metabase/lib/filter.cljc
index 218c6ba9671e..17c360a4ccd9 100644
--- a/src/metabase/lib/filter.cljc
+++ b/src/metabase/lib/filter.cljc
@@ -333,7 +333,7 @@
                                          style))
 
 (defmethod lib.metadata.calculation/display-name-method :time-interval
-  [query stage-number [_tag _opts expr n unit] style]
+  [query stage-number [_tag opts expr n unit] style]
   (if (clojure.core/or
        (clojure.core/= n :current)
        (clojure.core/= n 0)
@@ -342,10 +342,10 @@
         (clojure.core/= unit :day)))
     (i18n/tru "{0} is {1}"
               (lib.metadata.calculation/display-name query stage-number expr style)
-              (u/lower-case-en (lib.temporal-bucket/describe-temporal-interval n unit)))
+              (u/lower-case-en (lib.temporal-bucket/describe-temporal-interval n unit opts)))
     (i18n/tru "{0} is in the {1}"
               (lib.metadata.calculation/display-name query stage-number expr style)
-              (u/lower-case-en (lib.temporal-bucket/describe-temporal-interval n unit)))))
+              (u/lower-case-en (lib.temporal-bucket/describe-temporal-interval n unit opts)))))
 
 (defmethod lib.metadata.calculation/display-name-method :relative-time-interval
   [query stage-number [_tag _opts column value bucket offset-value offset-bucket] style]
@@ -361,11 +361,11 @@
 
 (defmethod lib.metadata.calculation/display-name-method :relative-datetime
   [_query _stage-number [_tag _opts n unit] _style]
-  (i18n/tru "{0}" (lib.temporal-bucket/describe-temporal-interval n unit)))
+  (lib.temporal-bucket/describe-temporal-interval n unit))
 
 (defmethod lib.metadata.calculation/display-name-method :interval
-  [_query _stage-number [_tag _opts n unit] _style]
-  (i18n/tru "{0}" (lib.temporal-bucket/describe-temporal-interval n unit)))
+  [_query _stage-number [_tag opts n unit] _style]
+  (lib.temporal-bucket/describe-temporal-interval n unit opts))
 
 (lib.common/defop and [x y & more])
 (lib.common/defop or [x y & more])
diff --git a/src/metabase/lib/temporal_bucket.cljc b/src/metabase/lib/temporal_bucket.cljc
index 0f4eded5d8c6..fac7cee106a3 100644
--- a/src/metabase/lib/temporal_bucket.cljc
+++ b/src/metabase/lib/temporal_bucket.cljc
@@ -80,67 +80,144 @@
 
 (mu/defn describe-temporal-interval :- ::lib.schema.common/non-blank-string
   "Get a translated description of a temporal bucketing interval. If unit is unspecified, assume `:day`."
-  [n    :- TemporalIntervalAmount
-   unit :- [:maybe :keyword]]
-  (let [n    (interval-n->int n)
-        unit (or unit :day)]
-    (case (keyword unit)
-      :millisecond     (temporal-interval-tru n
-                                              (i18n/tru  "This millisecond")
-                                              (i18n/tru  "Previous millisecond")
-                                              (i18n/trun "Previous {0} millisecond" "Previous {0} milliseconds" (abs n))
-                                              (i18n/tru  "Next millisecond")
-                                              (i18n/trun "Next {0} millisecond" "Next {0} milliseconds" (abs n)))
-      :second          (temporal-interval-tru n
-                                              (i18n/tru  "This second")
-                                              (i18n/tru  "Previous second")
-                                              (i18n/trun "Previous {0} second" "Previous {0} seconds" (abs n))
-                                              (i18n/tru  "Next second")
-                                              (i18n/trun "Next {0} second" "Next {0} seconds" (abs n)))
-      :minute          (temporal-interval-tru n
-                                              (i18n/tru  "This minute")
-                                              (i18n/tru  "Previous minute")
-                                              (i18n/trun "Previous {0} minute" "Previous {0} minutes" (abs n))
-                                              (i18n/tru  "Next minute")
-                                              (i18n/trun "Next {0} minute" "Next {0} minutes" (abs n)))
-      :hour            (temporal-interval-tru n
-                                              (i18n/tru  "This hour")
-                                              (i18n/tru  "Previous hour")
-                                              (i18n/trun "Previous {0} hour" "Previous {0} hours" (abs n))
-                                              (i18n/tru  "Next hour")
-                                              (i18n/trun "Next {0} hour" "Next {0} hours" (abs n)))
-      :day             (temporal-interval-tru n
-                                              (i18n/tru  "Today")
-                                              (i18n/tru  "Yesterday")
-                                              (i18n/trun "Previous {0} day" "Previous {0} days" (abs n))
-                                              (i18n/tru  "Tomorrow")
-                                              (i18n/trun "Next {0} day" "Next {0} days" (abs n)))
-      :week            (temporal-interval-tru n
-                                              (i18n/tru  "This week")
-                                              (i18n/tru  "Previous week")
-                                              (i18n/trun "Previous {0} week" "Previous {0} weeks" (abs n))
-                                              (i18n/tru  "Next week")
-                                              (i18n/trun "Next {0} week" "Next {0} weeks" (abs n)))
-      :month           (temporal-interval-tru n
-                                              (i18n/tru  "This month")
-                                              (i18n/tru  "Previous month")
-                                              (i18n/trun "Previous {0} month" "Previous {0} months" (abs n))
-                                              (i18n/tru  "Next month")
-                                              (i18n/trun "Next {0} month" "Next {0} months" (abs n)))
-      :quarter         (temporal-interval-tru n
-                                              (i18n/tru  "This quarter")
-                                              (i18n/tru  "Previous quarter")
-                                              (i18n/trun "Previous {0} quarter" "Previous {0} quarters" (abs n))
-                                              (i18n/tru  "Next quarter")
-                                              (i18n/trun "Next {0} quarter" "Next {0} quarters" (abs n)))
-      :year            (temporal-interval-tru n
-                                              (i18n/tru  "This year")
-                                              (i18n/tru  "Previous year")
-                                              (i18n/trun "Previous {0} year" "Previous {0} years" (abs n))
-                                              (i18n/tru  "Next year")
-                                              (i18n/trun "Next {0} year" "Next {0} years" (abs n)))
-      ;; else
-      (i18n/tru "Unknown unit"))))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]]
+   (describe-temporal-interval n unit nil))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]
+    opts :- [:maybe [:map [:include-current {:optional true} :boolean]]]]
+   (let [n                (interval-n->int n)
+         unit             (or unit :day)
+         include-current? (:include-current opts)]
+     (case (keyword unit)
+       :millisecond     (temporal-interval-tru n
+                                               (i18n/tru  "This millisecond")
+                                               (if include-current?
+                                                 (i18n/tru "Previous millisecond or this millisecond")
+                                                 (i18n/tru "Previous millisecond"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} milliseconds or this millisecond" (abs n))
+                                                 (i18n/tru "Previous {0} milliseconds" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next millisecond or this millisecond")
+                                                 (i18n/tru "Next millisecond"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} milliseconds or this millisecond" (abs n))
+                                                 (i18n/tru "Next {0} milliseconds" (abs n))))
+       :second          (temporal-interval-tru n
+                                               (i18n/tru  "This second")
+                                               (if include-current?
+                                                 (i18n/tru "Previous second or this second")
+                                                 (i18n/tru "Previous second"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} seconds or this second" (abs n))
+                                                 (i18n/tru "Previous {0} seconds" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next second or this second")
+                                                 (i18n/tru "Next second"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} seconds or this second" (abs n))
+                                                 (i18n/tru "Next {0} seconds" (abs n))))
+       :minute          (temporal-interval-tru n
+                                               (i18n/tru  "This minute")
+                                               (if include-current?
+                                                 (i18n/tru "Previous minute or this minute")
+                                                 (i18n/tru "Previous minute"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} minutes or this minute" (abs n))
+                                                 (i18n/tru "Previous {0} minutes" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next minute or this minute")
+                                                 (i18n/tru "Next minute"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} minutes or this minute" (abs n))
+                                                 (i18n/tru "Next {0} minutes" (abs n))))
+       :hour            (temporal-interval-tru n
+                                               (i18n/tru  "This hour")
+                                               (if include-current?
+                                                 (i18n/tru "Previous hour or this hour")
+                                                 (i18n/tru "Previous hour"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} hours or this hour" (abs n))
+                                                 (i18n/tru "Previous {0} hours" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next hour or this hour")
+                                                 (i18n/tru "Next hour"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} hours or this hour" (abs n))
+                                                 (i18n/tru "Next {0} hours" (abs n))))
+       :day             (temporal-interval-tru n
+                                               (i18n/tru  "Today")
+                                               (if include-current?
+                                                 (i18n/tru "Today or yesterday")
+                                                 (i18n/tru "Yesterday"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} days or today" (abs n))
+                                                 (i18n/tru "Previous {0} days" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Today or tomorrow")
+                                                 (i18n/tru "Tomorrow"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} days or today" (abs n))
+                                                 (i18n/tru "Next {0} days" (abs n))))
+       :week            (temporal-interval-tru n
+                                               (i18n/tru  "This week")
+                                               (if include-current?
+                                                 (i18n/tru "Previous week or this week")
+                                                 (i18n/tru "Previous week"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} weeks or this week" (abs n))
+                                                 (i18n/tru "Previous {0} weeks" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next week or this week")
+                                                 (i18n/tru "Next week"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} weeks or this week" (abs n))
+                                                 (i18n/tru "Next {0} weeks" (abs n))))
+       :month           (temporal-interval-tru n
+                                               (i18n/tru  "This month")
+                                               (if include-current?
+                                                 (i18n/tru "Previous month or this month")
+                                                 (i18n/tru "Previous month"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} months or this month" (abs n))
+                                                 (i18n/tru "Previous {0} months" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next month or this month")
+                                                 (i18n/tru "Next month"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} months or this month" (abs n))
+                                                 (i18n/tru "Next {0} months" (abs n))))
+       :quarter         (temporal-interval-tru n
+                                               (i18n/tru  "This quarter")
+                                               (if include-current?
+                                                 (i18n/tru "Previous quarter or this quarter")
+                                                 (i18n/tru "Previous quarter"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} quarters or this quarter" (abs n))
+                                                 (i18n/tru "Previous {0} quarters" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next quarter or this quarter")
+                                                 (i18n/tru "Next quarter"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} quarters or this quarter" (abs n))
+                                                 (i18n/tru "Next {0} quarters" (abs n))))
+       :year            (temporal-interval-tru n
+                                               (i18n/tru  "This year")
+                                               (if include-current?
+                                                 (i18n/tru "Previous year or this year")
+                                                 (i18n/tru "Previous year"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} years or this year" (abs n))
+                                                 (i18n/tru "Previous {0} years" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next year or this year")
+                                                 (i18n/tru "Next year"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} years or this year" (abs n))
+                                                 (i18n/tru "Next {0} years" (abs n))))
+       ;; else
+       (i18n/tru "Unknown unit")))))
 
 (defn- relative-datetime-tru
   "Chooses the correct relative interval description based on the provided amount `n`."
diff --git a/test/metabase/lib/temporal_bucket_test.cljc b/test/metabase/lib/temporal_bucket_test.cljc
index bddaed157203..d091aece25b2 100644
--- a/test/metabase/lib/temporal_bucket_test.cljc
+++ b/test/metabase/lib/temporal_bucket_test.cljc
@@ -20,14 +20,35 @@
         0  "Today"
         1  "Tomorrow"
         2  "Next 2 days")))
-  (testing :month
-    (are [n expected] (= expected
-                         (lib.temporal-bucket/describe-temporal-interval n :month))
-      -2 "Previous 2 months"
-      -1 "Previous month"
-      0  "This month"
-      1  "Next month"
-      2  "Next 2 months"))
+  (doseq [unit [:day nil]]
+    (testing (str (pr-str unit) " including current")
+      (are [n expected] (= expected
+                           (lib.temporal-bucket/describe-temporal-interval n unit {:include-current true}))
+        -2 "Previous 2 days or today"
+        -1 "Today or yesterday"
+        0  "Today"
+        1  "Today or tomorrow"
+        2  "Next 2 days or today")))
+  (doseq [unit [:millisecond :second :minute :hour :week :month :quarter :year]
+          :let [ustr (name unit)]]
+    (testing unit
+      (are [n expected] (= expected
+                           (lib.temporal-bucket/describe-temporal-interval n unit {:include-current false}))
+        -2 (str "Previous 2 " ustr "s")
+        -1 (str "Previous " ustr)
+        0  (str "This " ustr)
+        1  (str "Next " ustr)
+        2  (str "Next 2 " ustr "s"))))
+  (doseq [unit [:millisecond :second :minute :hour :week :month :quarter :year]
+          :let [ustr (name unit)]]
+    (testing (str unit " including current")
+      (are [n expected] (= expected
+                           (lib.temporal-bucket/describe-temporal-interval n unit {:include-current true}))
+        -2 (str "Previous 2 " ustr "s or this " ustr)
+        -1 (str "Previous " ustr " or this " ustr)
+        0  (str "This " ustr)
+        1  (str "Next " ustr " or this " ustr)
+        2  (str "Next 2 " ustr "s or this " ustr))))
   (testing "unknown unit"
     (are [n] (= "Unknown unit"
                 (lib.temporal-bucket/describe-temporal-interval n :century))


Reviews:
user: login: ranquild
body: code-wise lgtm. there is no workaround but to duplicate strings
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T16:01:45Z
user: login: appleby
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T16:20:04Z
user: login: appleby
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T16:22:24Z
user: login: appleby
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T16:36:20Z
user: login: metamben
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T20:05:13Z
user: login: appleby
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T21:38:38Z
user: login: appleby
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T21:41:43Z
user: login: metamben
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-30T23:25:18Z

Review comments:
diff_hunk: @@ -636,7 +636,7 @@ describe("scenarios > question > custom column", () => {
 
     H.queryBuilderMain().findByText("MiscDate").should("be.visible");
     cy.findByTestId("qb-filters-panel")
-      .findByText("MiscDate is in the previous 30 years")
+      .findByText("MiscDate is in the previous 30 or this year")
path: e2e/test/scenarios/custom-column/custom-column.cy.spec.js
user: login: appleby
body: Agree with @mngr's comment, this would read better as `"MiscDate is in the previous 30 years or this year"`
created_at: 2025-05-30T16:20:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -396,7 +396,7 @@ const RELATIVE_DATE_CASES = [
     offset: "Previous",
     unit: "month",
     value: 1,
-    expectedDisplayName: "Created At is in the previous month",
+    expectedDisplayName: "Created At is in the previous or this month",
path: e2e/test/scenarios/filters/filter-types.cy.spec.js
user: login: appleby
body: Same goes for the rest: `previous month or this month` etc
created_at: 2025-05-30T16:22:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,67 +80,180 @@
 
 (mu/defn describe-temporal-interval :- ::lib.schema.common/non-blank-string
   "Get a translated description of a temporal bucketing interval. If unit is unspecified, assume `:day`."
-  [n    :- TemporalIntervalAmount
-   unit :- [:maybe :keyword]]
-  (let [n    (interval-n->int n)
-        unit (or unit :day)]
-    (case (keyword unit)
-      :millisecond     (temporal-interval-tru n
-                                              (i18n/tru  "This millisecond")
-                                              (i18n/tru  "Previous millisecond")
-                                              (i18n/trun "Previous {0} millisecond" "Previous {0} milliseconds" (abs n))
-                                              (i18n/tru  "Next millisecond")
-                                              (i18n/trun "Next {0} millisecond" "Next {0} milliseconds" (abs n)))
-      :second          (temporal-interval-tru n
-                                              (i18n/tru  "This second")
-                                              (i18n/tru  "Previous second")
-                                              (i18n/trun "Previous {0} second" "Previous {0} seconds" (abs n))
-                                              (i18n/tru  "Next second")
-                                              (i18n/trun "Next {0} second" "Next {0} seconds" (abs n)))
-      :minute          (temporal-interval-tru n
-                                              (i18n/tru  "This minute")
-                                              (i18n/tru  "Previous minute")
-                                              (i18n/trun "Previous {0} minute" "Previous {0} minutes" (abs n))
-                                              (i18n/tru  "Next minute")
-                                              (i18n/trun "Next {0} minute" "Next {0} minutes" (abs n)))
-      :hour            (temporal-interval-tru n
-                                              (i18n/tru  "This hour")
-                                              (i18n/tru  "Previous hour")
-                                              (i18n/trun "Previous {0} hour" "Previous {0} hours" (abs n))
-                                              (i18n/tru  "Next hour")
-                                              (i18n/trun "Next {0} hour" "Next {0} hours" (abs n)))
-      :day             (temporal-interval-tru n
-                                              (i18n/tru  "Today")
-                                              (i18n/tru  "Yesterday")
-                                              (i18n/trun "Previous {0} day" "Previous {0} days" (abs n))
-                                              (i18n/tru  "Tomorrow")
-                                              (i18n/trun "Next {0} day" "Next {0} days" (abs n)))
-      :week            (temporal-interval-tru n
-                                              (i18n/tru  "This week")
-                                              (i18n/tru  "Previous week")
-                                              (i18n/trun "Previous {0} week" "Previous {0} weeks" (abs n))
-                                              (i18n/tru  "Next week")
-                                              (i18n/trun "Next {0} week" "Next {0} weeks" (abs n)))
-      :month           (temporal-interval-tru n
-                                              (i18n/tru  "This month")
-                                              (i18n/tru  "Previous month")
-                                              (i18n/trun "Previous {0} month" "Previous {0} months" (abs n))
-                                              (i18n/tru  "Next month")
-                                              (i18n/trun "Next {0} month" "Next {0} months" (abs n)))
-      :quarter         (temporal-interval-tru n
-                                              (i18n/tru  "This quarter")
-                                              (i18n/tru  "Previous quarter")
-                                              (i18n/trun "Previous {0} quarter" "Previous {0} quarters" (abs n))
-                                              (i18n/tru  "Next quarter")
-                                              (i18n/trun "Next {0} quarter" "Next {0} quarters" (abs n)))
-      :year            (temporal-interval-tru n
-                                              (i18n/tru  "This year")
-                                              (i18n/tru  "Previous year")
-                                              (i18n/trun "Previous {0} year" "Previous {0} years" (abs n))
-                                              (i18n/tru  "Next year")
-                                              (i18n/trun "Next {0} year" "Next {0} years" (abs n)))
-      ;; else
-      (i18n/tru "Unknown unit"))))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]]
+   (describe-temporal-interval n unit nil))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]
+    opts :- [:maybe [:map [:include-current {:optional true} :boolean]]]]
+   (let [n                (interval-n->int n)
+         unit             (or unit :day)
+         include-current? (:include-current opts)]
+     (case (keyword unit)
+       :millisecond     (temporal-interval-tru n
+                                               (i18n/tru  "This millisecond")
+                                               (if include-current?
+                                                 (i18n/tru "Previous or this millisecond")
path: src/metabase/lib/temporal_bucket.cljc
user: login: appleby
body: This one is more of a grey area. Ultimately a product question, I guess. I can see the advantage of having a more compact string for longer ones like this, specifically where the number is singular (implied "1").
created_at: 2025-05-30T16:36:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,67 +80,180 @@
 
 (mu/defn describe-temporal-interval :- ::lib.schema.common/non-blank-string
   "Get a translated description of a temporal bucketing interval. If unit is unspecified, assume `:day`."
-  [n    :- TemporalIntervalAmount
-   unit :- [:maybe :keyword]]
-  (let [n    (interval-n->int n)
-        unit (or unit :day)]
-    (case (keyword unit)
-      :millisecond     (temporal-interval-tru n
-                                              (i18n/tru  "This millisecond")
-                                              (i18n/tru  "Previous millisecond")
-                                              (i18n/trun "Previous {0} millisecond" "Previous {0} milliseconds" (abs n))
-                                              (i18n/tru  "Next millisecond")
-                                              (i18n/trun "Next {0} millisecond" "Next {0} milliseconds" (abs n)))
-      :second          (temporal-interval-tru n
-                                              (i18n/tru  "This second")
-                                              (i18n/tru  "Previous second")
-                                              (i18n/trun "Previous {0} second" "Previous {0} seconds" (abs n))
-                                              (i18n/tru  "Next second")
-                                              (i18n/trun "Next {0} second" "Next {0} seconds" (abs n)))
-      :minute          (temporal-interval-tru n
-                                              (i18n/tru  "This minute")
-                                              (i18n/tru  "Previous minute")
-                                              (i18n/trun "Previous {0} minute" "Previous {0} minutes" (abs n))
-                                              (i18n/tru  "Next minute")
-                                              (i18n/trun "Next {0} minute" "Next {0} minutes" (abs n)))
-      :hour            (temporal-interval-tru n
-                                              (i18n/tru  "This hour")
-                                              (i18n/tru  "Previous hour")
-                                              (i18n/trun "Previous {0} hour" "Previous {0} hours" (abs n))
-                                              (i18n/tru  "Next hour")
-                                              (i18n/trun "Next {0} hour" "Next {0} hours" (abs n)))
-      :day             (temporal-interval-tru n
-                                              (i18n/tru  "Today")
-                                              (i18n/tru  "Yesterday")
-                                              (i18n/trun "Previous {0} day" "Previous {0} days" (abs n))
-                                              (i18n/tru  "Tomorrow")
-                                              (i18n/trun "Next {0} day" "Next {0} days" (abs n)))
-      :week            (temporal-interval-tru n
-                                              (i18n/tru  "This week")
-                                              (i18n/tru  "Previous week")
-                                              (i18n/trun "Previous {0} week" "Previous {0} weeks" (abs n))
-                                              (i18n/tru  "Next week")
-                                              (i18n/trun "Next {0} week" "Next {0} weeks" (abs n)))
-      :month           (temporal-interval-tru n
-                                              (i18n/tru  "This month")
-                                              (i18n/tru  "Previous month")
-                                              (i18n/trun "Previous {0} month" "Previous {0} months" (abs n))
-                                              (i18n/tru  "Next month")
-                                              (i18n/trun "Next {0} month" "Next {0} months" (abs n)))
-      :quarter         (temporal-interval-tru n
-                                              (i18n/tru  "This quarter")
-                                              (i18n/tru  "Previous quarter")
-                                              (i18n/trun "Previous {0} quarter" "Previous {0} quarters" (abs n))
-                                              (i18n/tru  "Next quarter")
-                                              (i18n/trun "Next {0} quarter" "Next {0} quarters" (abs n)))
-      :year            (temporal-interval-tru n
-                                              (i18n/tru  "This year")
-                                              (i18n/tru  "Previous year")
-                                              (i18n/trun "Previous {0} year" "Previous {0} years" (abs n))
-                                              (i18n/tru  "Next year")
-                                              (i18n/trun "Next {0} year" "Next {0} years" (abs n)))
-      ;; else
-      (i18n/tru "Unknown unit"))))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]]
+   (describe-temporal-interval n unit nil))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]
+    opts :- [:maybe [:map [:include-current {:optional true} :boolean]]]]
+   (let [n                (interval-n->int n)
+         unit             (or unit :day)
+         include-current? (:include-current opts)]
+     (case (keyword unit)
+       :millisecond     (temporal-interval-tru n
+                                               (i18n/tru  "This millisecond")
+                                               (if include-current?
+                                                 (i18n/tru "Previous or this millisecond")
path: src/metabase/lib/temporal_bucket.cljc
user: login: metamben
body: I've chosen to repeat the unit.
created_at: 2025-05-30T20:05:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,67 +80,144 @@
 
 (mu/defn describe-temporal-interval :- ::lib.schema.common/non-blank-string
   "Get a translated description of a temporal bucketing interval. If unit is unspecified, assume `:day`."
-  [n    :- TemporalIntervalAmount
-   unit :- [:maybe :keyword]]
-  (let [n    (interval-n->int n)
-        unit (or unit :day)]
-    (case (keyword unit)
-      :millisecond     (temporal-interval-tru n
-                                              (i18n/tru  "This millisecond")
-                                              (i18n/tru  "Previous millisecond")
-                                              (i18n/trun "Previous {0} millisecond" "Previous {0} milliseconds" (abs n))
-                                              (i18n/tru  "Next millisecond")
-                                              (i18n/trun "Next {0} millisecond" "Next {0} milliseconds" (abs n)))
-      :second          (temporal-interval-tru n
-                                              (i18n/tru  "This second")
-                                              (i18n/tru  "Previous second")
-                                              (i18n/trun "Previous {0} second" "Previous {0} seconds" (abs n))
-                                              (i18n/tru  "Next second")
-                                              (i18n/trun "Next {0} second" "Next {0} seconds" (abs n)))
-      :minute          (temporal-interval-tru n
-                                              (i18n/tru  "This minute")
-                                              (i18n/tru  "Previous minute")
-                                              (i18n/trun "Previous {0} minute" "Previous {0} minutes" (abs n))
-                                              (i18n/tru  "Next minute")
-                                              (i18n/trun "Next {0} minute" "Next {0} minutes" (abs n)))
-      :hour            (temporal-interval-tru n
-                                              (i18n/tru  "This hour")
-                                              (i18n/tru  "Previous hour")
-                                              (i18n/trun "Previous {0} hour" "Previous {0} hours" (abs n))
-                                              (i18n/tru  "Next hour")
-                                              (i18n/trun "Next {0} hour" "Next {0} hours" (abs n)))
-      :day             (temporal-interval-tru n
-                                              (i18n/tru  "Today")
-                                              (i18n/tru  "Yesterday")
-                                              (i18n/trun "Previous {0} day" "Previous {0} days" (abs n))
-                                              (i18n/tru  "Tomorrow")
-                                              (i18n/trun "Next {0} day" "Next {0} days" (abs n)))
-      :week            (temporal-interval-tru n
-                                              (i18n/tru  "This week")
-                                              (i18n/tru  "Previous week")
-                                              (i18n/trun "Previous {0} week" "Previous {0} weeks" (abs n))
-                                              (i18n/tru  "Next week")
-                                              (i18n/trun "Next {0} week" "Next {0} weeks" (abs n)))
-      :month           (temporal-interval-tru n
-                                              (i18n/tru  "This month")
-                                              (i18n/tru  "Previous month")
-                                              (i18n/trun "Previous {0} month" "Previous {0} months" (abs n))
-                                              (i18n/tru  "Next month")
-                                              (i18n/trun "Next {0} month" "Next {0} months" (abs n)))
-      :quarter         (temporal-interval-tru n
-                                              (i18n/tru  "This quarter")
-                                              (i18n/tru  "Previous quarter")
-                                              (i18n/trun "Previous {0} quarter" "Previous {0} quarters" (abs n))
-                                              (i18n/tru  "Next quarter")
-                                              (i18n/trun "Next {0} quarter" "Next {0} quarters" (abs n)))
-      :year            (temporal-interval-tru n
-                                              (i18n/tru  "This year")
-                                              (i18n/tru  "Previous year")
-                                              (i18n/trun "Previous {0} year" "Previous {0} years" (abs n))
-                                              (i18n/tru  "Next year")
-                                              (i18n/trun "Next {0} year" "Next {0} years" (abs n)))
-      ;; else
-      (i18n/tru "Unknown unit"))))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]]
+   (describe-temporal-interval n unit nil))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]
+    opts :- [:maybe [:map [:include-current {:optional true} :boolean]]]]
+   (let [n                (interval-n->int n)
+         unit             (or unit :day)
+         include-current? (:include-current opts)]
+     (case (keyword unit)
+       :millisecond     (temporal-interval-tru n
+                                               (i18n/tru  "This millisecond")
+                                               (if include-current?
+                                                 (i18n/tru "Previous millisecond or this millisecond")
+                                                 (i18n/tru "Previous millisecond"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} milliseconds or this millisecond" (abs n))
+                                                 (i18n/tru "Previous {0} milliseconds" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next millisecond or this millisecond")
+                                                 (i18n/tru "Next millisecond"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} milliseconds or this millisecond" (abs n))
+                                                 (i18n/tru "Next {0} milliseconds" (abs n))))
+       :second          (temporal-interval-tru n
+                                               (i18n/tru  "This second")
+                                               (if include-current?
+                                                 (i18n/tru "Previous second or this second")
+                                                 (i18n/tru "Previous second"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} seconds or this second" (abs n))
+                                                 (i18n/tru "Previous {0} seconds" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next second or this second")
+                                                 (i18n/tru "Next second"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} seconds or this second" (abs n))
+                                                 (i18n/tru "Next {0} seconds" (abs n))))
+       :minute          (temporal-interval-tru n
+                                               (i18n/tru  "This minute")
+                                               (if include-current?
+                                                 (i18n/tru "Previous minute or this minute")
+                                                 (i18n/tru "Previous minute"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} minutes or this minute" (abs n))
+                                                 (i18n/tru "Previous {0} minutes" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next minute or this minute")
+                                                 (i18n/tru "Next minute"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} minutes or this minute" (abs n))
+                                                 (i18n/tru "Next {0} minutes" (abs n))))
+       :hour            (temporal-interval-tru n
+                                               (i18n/tru  "This hour")
+                                               (if include-current?
+                                                 (i18n/tru "Previous hour or this hour")
+                                                 (i18n/tru "Previous hour"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} hours or this hour" (abs n))
+                                                 (i18n/tru "Previous {0} hours" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next hour or this hour")
+                                                 (i18n/tru "Next hour"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} hours or this hour" (abs n))
+                                                 (i18n/tru "Next {0} hours" (abs n))))
+       :day             (temporal-interval-tru n
+                                               (i18n/tru  "Today")
+                                               (if include-current?
+                                                 (i18n/tru "Today or yesterday")
path: src/metabase/lib/temporal_bucket.cljc
user: login: appleby
body: This reads fine, just wanted to make sure it was intentional as it looks like the only one that breaks the pattern of putting current last (and "Yesterday or today" also sounds good to me).
created_at: 2025-05-30T21:38:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -80,67 +80,144 @@
 
 (mu/defn describe-temporal-interval :- ::lib.schema.common/non-blank-string
   "Get a translated description of a temporal bucketing interval. If unit is unspecified, assume `:day`."
-  [n    :- TemporalIntervalAmount
-   unit :- [:maybe :keyword]]
-  (let [n    (interval-n->int n)
-        unit (or unit :day)]
-    (case (keyword unit)
-      :millisecond     (temporal-interval-tru n
-                                              (i18n/tru  "This millisecond")
-                                              (i18n/tru  "Previous millisecond")
-                                              (i18n/trun "Previous {0} millisecond" "Previous {0} milliseconds" (abs n))
-                                              (i18n/tru  "Next millisecond")
-                                              (i18n/trun "Next {0} millisecond" "Next {0} milliseconds" (abs n)))
-      :second          (temporal-interval-tru n
-                                              (i18n/tru  "This second")
-                                              (i18n/tru  "Previous second")
-                                              (i18n/trun "Previous {0} second" "Previous {0} seconds" (abs n))
-                                              (i18n/tru  "Next second")
-                                              (i18n/trun "Next {0} second" "Next {0} seconds" (abs n)))
-      :minute          (temporal-interval-tru n
-                                              (i18n/tru  "This minute")
-                                              (i18n/tru  "Previous minute")
-                                              (i18n/trun "Previous {0} minute" "Previous {0} minutes" (abs n))
-                                              (i18n/tru  "Next minute")
-                                              (i18n/trun "Next {0} minute" "Next {0} minutes" (abs n)))
-      :hour            (temporal-interval-tru n
-                                              (i18n/tru  "This hour")
-                                              (i18n/tru  "Previous hour")
-                                              (i18n/trun "Previous {0} hour" "Previous {0} hours" (abs n))
-                                              (i18n/tru  "Next hour")
-                                              (i18n/trun "Next {0} hour" "Next {0} hours" (abs n)))
-      :day             (temporal-interval-tru n
-                                              (i18n/tru  "Today")
-                                              (i18n/tru  "Yesterday")
-                                              (i18n/trun "Previous {0} day" "Previous {0} days" (abs n))
-                                              (i18n/tru  "Tomorrow")
-                                              (i18n/trun "Next {0} day" "Next {0} days" (abs n)))
-      :week            (temporal-interval-tru n
-                                              (i18n/tru  "This week")
-                                              (i18n/tru  "Previous week")
-                                              (i18n/trun "Previous {0} week" "Previous {0} weeks" (abs n))
-                                              (i18n/tru  "Next week")
-                                              (i18n/trun "Next {0} week" "Next {0} weeks" (abs n)))
-      :month           (temporal-interval-tru n
-                                              (i18n/tru  "This month")
-                                              (i18n/tru  "Previous month")
-                                              (i18n/trun "Previous {0} month" "Previous {0} months" (abs n))
-                                              (i18n/tru  "Next month")
-                                              (i18n/trun "Next {0} month" "Next {0} months" (abs n)))
-      :quarter         (temporal-interval-tru n
-                                              (i18n/tru  "This quarter")
-                                              (i18n/tru  "Previous quarter")
-                                              (i18n/trun "Previous {0} quarter" "Previous {0} quarters" (abs n))
-                                              (i18n/tru  "Next quarter")
-                                              (i18n/trun "Next {0} quarter" "Next {0} quarters" (abs n)))
-      :year            (temporal-interval-tru n
-                                              (i18n/tru  "This year")
-                                              (i18n/tru  "Previous year")
-                                              (i18n/trun "Previous {0} year" "Previous {0} years" (abs n))
-                                              (i18n/tru  "Next year")
-                                              (i18n/trun "Next {0} year" "Next {0} years" (abs n)))
-      ;; else
-      (i18n/tru "Unknown unit"))))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]]
+   (describe-temporal-interval n unit nil))
+  ([n    :- TemporalIntervalAmount
+    unit :- [:maybe :keyword]
+    opts :- [:maybe [:map [:include-current {:optional true} :boolean]]]]
+   (let [n                (interval-n->int n)
+         unit             (or unit :day)
+         include-current? (:include-current opts)]
+     (case (keyword unit)
+       :millisecond     (temporal-interval-tru n
+                                               (i18n/tru  "This millisecond")
+                                               (if include-current?
+                                                 (i18n/tru "Previous millisecond or this millisecond")
+                                                 (i18n/tru "Previous millisecond"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} milliseconds or this millisecond" (abs n))
+                                                 (i18n/tru "Previous {0} milliseconds" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next millisecond or this millisecond")
+                                                 (i18n/tru "Next millisecond"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} milliseconds or this millisecond" (abs n))
+                                                 (i18n/tru "Next {0} milliseconds" (abs n))))
+       :second          (temporal-interval-tru n
+                                               (i18n/tru  "This second")
+                                               (if include-current?
+                                                 (i18n/tru "Previous second or this second")
+                                                 (i18n/tru "Previous second"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} seconds or this second" (abs n))
+                                                 (i18n/tru "Previous {0} seconds" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next second or this second")
+                                                 (i18n/tru "Next second"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} seconds or this second" (abs n))
+                                                 (i18n/tru "Next {0} seconds" (abs n))))
+       :minute          (temporal-interval-tru n
+                                               (i18n/tru  "This minute")
+                                               (if include-current?
+                                                 (i18n/tru "Previous minute or this minute")
+                                                 (i18n/tru "Previous minute"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} minutes or this minute" (abs n))
+                                                 (i18n/tru "Previous {0} minutes" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next minute or this minute")
+                                                 (i18n/tru "Next minute"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} minutes or this minute" (abs n))
+                                                 (i18n/tru "Next {0} minutes" (abs n))))
+       :hour            (temporal-interval-tru n
+                                               (i18n/tru  "This hour")
+                                               (if include-current?
+                                                 (i18n/tru "Previous hour or this hour")
+                                                 (i18n/tru "Previous hour"))
+                                               (if include-current?
+                                                 (i18n/tru "Previous {0} hours or this hour" (abs n))
+                                                 (i18n/tru "Previous {0} hours" (abs n)))
+                                               (if include-current?
+                                                 (i18n/tru "Next hour or this hour")
+                                                 (i18n/tru "Next hour"))
+                                               (if include-current?
+                                                 (i18n/tru "Next {0} hours or this hour" (abs n))
+                                                 (i18n/tru "Next {0} hours" (abs n))))
+       :day             (temporal-interval-tru n
+                                               (i18n/tru  "Today")
+                                               (if include-current?
+                                                 (i18n/tru "Today or yesterday")
path: src/metabase/lib/temporal_bucket.cljc
user: login: metamben
body: This can be swapped without complication. I understood this order was slightly easier on the ears.
created_at: 2025-05-30T23:25:18Z
author_association: CONTRIBUTOR

PR comments:
user: login: trunk-io[bot]
created_at: 2025-05-29T19:17:10Z
body: <!-- Trunk Test Analytics -->


[![Static Badge](https://raster.shields.io/badge/128290_tests-2d689604-purple)](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment) &ensp; [![Static Badge](https://raster.shields.io/badge/3-failed-crimson)](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE) &ensp; [![Static Badge](https://raster.shields.io/badge/7-flaky-red)](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE) &ensp; [![Static Badge](https://raster.shields.io/badge/0-quarantined-yellow)](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=QUARANTINED)


| Failed Test | Failure Summary | Logs |
| --- | --- | --- |
| <code>create-db-succesful-track-snowplow-test</code> | The expected database connection event was not as expected, with missing database ID and version information. | [Logs ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE&runId=3de45265-3c97-5cf6-9907-8c21f76eb10b) |
| <code>with-mbql-card-test-2</code> | Expected value to be an instance of Card, but got nil. | [Logs ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE&runId=8adcba60-cd4d-5894-9ac6-0f3a6173b93d) |
| <code>duplicate-native-queries-e2e-test</code> | Query caching failed to cache results correctly for two native cards with the same inner query. | [Logs ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE&runId=f772e0a3-96be-5c17-9cdd-309dfcc3c517) |


| Flaky Test | Failure Summary | Logs |
| --- | --- | --- |
| <code>get-schemas-test</code> | Deadlock found when trying to get lock; try restarting transaction | [Logs ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE&runId=4db619f4-559f-50e5-b8eb-9752e79dc958) |
| <code>refingerprint-fields-for-db!-test</code> | failure\_text: fingerprint\_test.clj:331:redshiftrefingerprints up to a limitexpected: (< attempted (+ @\#'sync.fingerprint/max-refingerprint-field... | [Logs ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE&runId=66bb2160-190d-5fda-94a3-7ecbe98733eb) |
| <code>issue 16170 replace missing values with "Nothing" should work on Mongo (metabase\#16170)</code> | Unable to find an element with data-testid "echarts-tooltip" within 4 seconds. | [Logs ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE&runId=6f08d6de-3dae-52f0-ad83-3aaac0050cd6) |
| <code>issue 41785, issue 46756 does not break the question when removing column with the same mapping as another column (metabase\#41785) (metabase\#46756)</code> | The test timed out while trying to find an element with data-testid "loading-indicator". | [Logs ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE&runId=a0ea7f9a-4dd2-5f35-b948-2d72421d6d63) |

[... and 3 more](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment&runConclusion=FAILURE)
<sub>

[View Full Report ↗︎](https://app.trunk.io/metabase/flaky-tests/pr/58662?repo=metabase/metabase&commitHash=2d689604c7cad12d8eb97c78a47496033c1b5d96&utm_source=gh-comment) ⋅ [Docs](https://docs.trunk.io/flaky-tests?utm_source=gh-comment)

</sub>
author_association: NONE
user: login: mngr
created_at: 2025-05-29T21:03:44Z
body: <img width="429" alt="Captura de ecrã 2025-05-29, às 22 02 10" src="https://github.com/user-attachments/assets/eb9936ba-9088-45a4-af9b-840a97411085" />
<img width="455" alt="Captura de ecrã 2025-05-29, às 22 03 13" src="https://github.com/user-attachments/assets/40bd0d8b-c8aa-4cbe-b839-00e0f8a54845" />

I guess it should be: "In the previous 3 months or this month", "In the next 30 weeks or this week"
author_association: NONE
user: login: github-actions[bot]
created_at: 2025-05-30T20:16:16Z
body: 
  ## e2e tests failed on `2d689604c7cad12d8eb97c78a47496033c1b5d96-2`

  [e2e test run](https://github.com/metabase/metabase/actions/runs/15354792720?pr=58662)

  File | Test Name
  ---- | ---------
  `reproductions.cy.spec.ts` | issue 41785, issue 46756 > does not break the question when removing column with the same mapping as another column (metabase#41785) (metabase#46756)

author_association: CONTRIBUTOR