Skip to content

feat(time-range-limits): add time range limits for chart queries - #46038

Open
DamianPendrak wants to merge 94 commits into
apache:masterfrom
DamianPendrak:feat/time-range-limits
Open

DamianPendrak wants to merge 94 commits into
apache:masterfrom
DamianPendrak:feat/time-range-limits

Conversation

@DamianPendrak

@DamianPendrak DamianPendrak commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

SUMMARY

Add time range limits for chart queries: a longest range (max_span), earliest start (max_look_back), and latest end (max_look_forward). Deployment config sets the global policy; dataset and dashboard editors can add stricter limits. The strictest applicable rule wins. TIME_RANGE_LIMITS is off by default. With it on, the server checks before cache lookup, async execution, or SQL. An out-of-range or unbounded chart query returns HTTP 400 with TIME_RANGE_LIMIT_ERROR (issue 1042); an invalid applicable stored policy fails closed with HTTP 503. Charts on datasets or semantic views with no temporal column run unchanged, even when a policy is invalid.

  • Explore shows limits in its time range picker and checks Run and Save. Dashboard native filters, charts, and Properties show limits, reasons, and a save check; dashboard editors receive a one-time notice when global limits turn on or tighten. Dataset editors set dataset limits. Admins get a read-only "Time range limits" page under Settings → Manage.
  • Checks also cover scheduled reports, alerts that attach a chart or dashboard, MCP data tools, semantic-view charts, samples, time comparisons, async tasks, cache warm-up, and the dashboard example export with data (API and superset export-example), which leaves out the data of limited datasets. Reports and alerts with a refused chart send nothing and fail with the time range reason. Async tasks recheck before SQL.
  • The maximum span is counted back from the range end, the way Superset builds "Last N months", so Superset's own presets pass a limit of the same length. On engines that group time inline, a chart with a series limit also needs a time filter that bounds its ranking subquery, or it's refused as unbounded. A native Select filter's option list, a Range filter's min and max, and Explore's filter value list with no time range read only the latest window the limits allow, on the filter's time column or the dataset's default datetime column, so filter choices still load; a list that carries a time range is checked like a chart. The filter settings' "Pre-filter available values" picker uses the limited picker: no "No filter", and a range past the limit blocks Save. Lists on semantic views stay as they are. Alert SQL is exempt.
  • With the flag off, query enforcement and the time range limits endpoints are inactive, and existing requests without a time_range_limits key behave as before. Dashboard values are still checked for shape (400 on writes, 422 on imports, 500 on an asset bundle import), but not for units or strictness; dataset values aren't checked, as on master. Review stored policies before turning the flag on; invalid applicable policies then fail closed. An older version without this feature answers 400 "Unknown field" when a dashboard with a stored time_range_limits key is saved, so remove the key before rolling back (see UPDATING).
  • With the flag on, dashboard copies (Save as, the copy API) and dashboard imports over an existing dashboard, archived ones included (v0, v1, asset bundle, CLI), ask before changing time ranges. If an inherited rule is looser than the global one, or a Time Range filter default doesn't fit, the first attempt stores nothing and lists every change in plain words; Save as and the import modal show Adjust and copy / Adjust and import or Cancel, and the API applies the changes only with adjust_time_ranges and the listed changes' fingerprint (CLI: --adjust-time-ranges). A default that doesn't fit becomes a rolling range of the allowed length (e.g. "Last 14 days"). MCP duplicate_dashboard returns the list as its error. Stricter rules and the source dashboard are never changed. A new dashboard with a looser rule is refused with 422, and so is a copy or import that would leave look-back and look-forward both at 0, or whose Time Range default can't fit any rolling range.
  • Time range limits protect databases from expensive chart queries. They are not an access control and not a security boundary: they don't change which rows a user may read, and paths outside chart data, such as SQL Lab and alert SQL, aren't checked.

Shared-code changes:

  • ImportExportMixin find-existing lookup helpers centralize matching for import validation, including existing rows that a policy may overwrite.
  • Time offset helpers move to common/utils/time_range_utils.py so query building and limit checks use the same offset handling.
  • Query-context and serialization paths expose and check the actual time ranges, including comparison and annotation-layer ranges, before execution.
  • With the flag on, the Jinja macros that read request form data (url_param, get_filters/filter_values, get_time_filter) read the query the check validated, through a new get_form_data(checked=True) parameter, as the async worker already does. Plain get_form_data() is unchanged.
  • buildV1ChartDataPayload takes an optional cachedChanges. When a caller passes extras.cachedChanges, the Table and AG Grid cachedBuildQuery wrappers read that cache and leave their own alone; everything else is as on master. Explore's time range check uses it, so it never uses up the table's reset to the first page.
  • Chart-data, async task, report, alert, warm-up, datasource, and MCP entry points call the shared enforcement path so alternate query routes cannot bypass limits.
  • Dashboard/dataset APIs, import and restore commands, and audit hooks validate and record policy writes across their existing write paths; dashboard copy and import compute the time range changes, return them for confirmation, and apply them only with consent. The import modal and Save as reuse Superset's existing import confirmation pattern. UI core adds shared range lookup and types for the picker and editors.

Upgrade: Run superset init to register the new TimeRangeLimits permission and admin menu item. No database migration is required.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Image Image Image Image Image

TESTING INSTRUCTIONS

  1. In superset_config.py, enable FEATURE_FLAGS["TIME_RANGE_LIMITS"] = True and set TIME_RANGE_LIMITS_GLOBAL = {"schema_version": 1, "max_span": {"quantity": 3, "time_grain": "P1M"}, "max_look_back": {"quantity": 13, "time_grain": "P1M"}, "max_look_forward": {"quantity": 0, "time_grain": "P1D"}}. Restart Superset and run superset init.
  2. In a temporal dataset's Settings tab, set a stricter longest range. In a dashboard's Properties, set a stricter dashboard limit. Confirm the effective limit is the strictest and the save check lists charts/defaults it would refuse. Save, reopen, and confirm persistence.
  3. In Explore, try allowed and out-of-range dates, presets, and time comparisons. Confirm invalid ranges disable Run/Save or Apply as appropriate. On the dashboard, repeat with a native time range filter and confirm charts are held with a useful message until the filter is fixed.
  4. Open Settings → Manage → Time range limits as an admin. Confirm the global policy is read-only. A non-admin should not have access.
  5. Call chart data with an out-of-range or unbounded temporal query: expect HTTP 400, issue 1042, and no SQL. Put an invalid applicable stored policy in a test fixture: expect HTTP 503 POLICY_UNAVAILABLE. Turn the flag off and confirm chart queries are unaffected, the time range limits endpoints return 404, and a dashboard save with "time_range_limits": "junk" returns 400.
  6. Export a dashboard whose Time Range filter default is longer than the global limit, then tighten the global limit. Use Save as on it, and re-import the export over it: each shows the list of time range changes with Adjust or Cancel. Cancel stores nothing; Adjust saves exactly the listed changes. The same import through the API without adjust_time_ranges returns 422 with the list.
  7. Run focused backend tests: pytest tests/unit_tests/utils/test_time_range_enforcement.py tests/unit_tests/utils/test_time_range_limits.py tests/unit_tests/utils/test_time_range_save_check.py tests/integration_tests/time_range_limits_tests.py. Run focused frontend tests from superset-frontend: npm run test -- timeRangeLimits.test.ts TimeRangeLimitsSection.test.tsx TimeRangeLimits.test.tsx.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: TIME_RANGE_LIMITS
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Introduces new feature or API
  • Removes existing feature or API

@netlify

netlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit b4077d7
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6aef0c9d914935e163dd9539
😎 Deploy Preview https://deploy-preview-46038--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added i18n Namespace | Anything related to localization api Related to the REST API doc Namespace | Anything related to documentation packages risk:chart-metadata labels Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.57795% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.61%. Comparing base (3758941) to head (2c282c7).

Files with missing lines Patch % Lines
...mponents/DashboardBuilder/TimeRangeLimitsAlert.tsx 94.13% 17 Missing ⚠️
...c/components/TimeRangeLimits/useTimeRangeLimits.ts 90.68% 15 Missing ⚠️
...-frontend/src/dashboard/actions/timeRangeLimits.ts 97.47% 6 Missing ⚠️
...tend/src/components/TimeRangeLimits/policyDraft.ts 96.93% 3 Missing ⚠️
...d/src/components/TimeRangeAdjustmentList/index.tsx 93.93% 2 Missing ⚠️
...rc/components/Datasource/DatasourceModal/index.tsx 98.11% 1 Missing ⚠️
...s/DashboardBuilder/TimeRangeLimitsEditorNotice.tsx 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #46038      +/-   ##
==========================================
+ Coverage   86.09%   86.61%   +0.52%     
==========================================
  Files        3140     3190      +50     
  Lines      219205   227936    +8731     
  Branches    51973    54359    +2386     
==========================================
+ Hits       188721   197427    +8706     
+ Misses      27055    27018      -37     
- Partials     3429     3491      +62     
Flag Coverage Δ
hive 33.53% <ø> (-0.16%) ⬇️
javascript 83.70% <96.57%> (+0.79%) ⬆️
mysql 52.46% <ø> (+0.99%) ⬆️
postgres 52.49% <ø> (+0.99%) ⬆️
presto 35.18% <ø> (-0.20%) ⬇️
python 88.88% <ø> (+0.30%) ⬆️
sqlite 52.18% <ø> (+1.00%) ⬆️
superset-extensions-cli 91.26% <ø> (?)
unit 84.68% <ø> (+0.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Nov 7, 2026
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Nov 7, 2026
"quantity": 3,
"time_grain": "P1M"
},
"message": "Range can't be longer than 3 months. This one is 3 months and 3 days."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixture locks in a bug: the span check adds months forward from since (Feb 28 + 3M = May 28), but the preset clamps since backward from until (May 31 − 3M = Feb 28). As a result, "Last 3 months" fails a 3-month max_span on month-end days and passes on other days, and the README's own example config hits this; "Last month" on Mar 31 fails the same way at line 2167.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, fixed in 39baff4. The longest range is now counted back from the end, the same way "Last N months" is built, on the server and in the browser. The fixture has month-end cases.

"quantity": 6,
"time_grain": "PT1H"
},
"message": "Range can't be longer than 6 hours. This one is 7 hours."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A range of 6h 0m 1s is reported as "This one is 7 hours", so the rounding-up message overstates how far over the limit the range is.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a5a12f1 and f322d11. The message gives whole units plus the rest, so 6h 0m 1s reads "6 hours and 1 minute".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the product decision, refused ranges are again shown in the limit's own unit rounded up to a whole unit.

@geido

geido commented Nov 9, 2026

Copy link
Copy Markdown
Member

Some recordings and API output for the inline comments below, from a local run of this branch with TIME_RANGE_LIMITS on and off (global limits: 3 months span, 13 months back, nothing in the future), and master as a baseline.

Gamma user: a dataset template widened by an unchecked adhoc_filters key, and result_type samples skipping the unbounded check

Gamma user: export_as_example returns whole tables with the flag on

Dashboard report with an orphan chart: fails with the flag on, renders with it off

explore-pagination-flag-on.mp4

Server-paginated table after a time range change: flag on (left) shows No results next to 8 rows, flag off (right) shows the rows

dashboard-refresh-check-failure.mp4

Save as after the stored limit became looser than the global, and a junk time_range_limits value stored with the flag off

Explore filter value dropdown: flag on (left) lists nothing, flag off (right) lists 4 options

Master saving a dashboard that carries time_range_limits: 400 Unknown field, Invalid input toast

Mirrors the column lookup of ``get_sqla_query`` (name, then verbose name): a
filter whose column isn't found is skipped there, and one on an adhoc column or
a metric fails the query, so neither bounds anything. A filter on a column that
isn't temporal bounds nothing either. A filter a dataset template removes still

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a dataset template can widen the range past this check. get_time_filter('order_date', remove_filter=True) reads the raw request via get_form_data(), so an extra adhoc_filters key the schema drops wins (whole table back as Gamma). Could the sync path render from the checked query, as the worker does?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in 4e01ef4, 76b40bb, 4cabc93 and a367406, test in fa69cea. With the flag on, the form-data lookup in url_param, get_filters and get_time_filter reads the query the check validated, so a key the schema drops can't come back through raw form data.

- **Editor notice:** when the global limits turn on, or a global rule gets stricter, each dashboard editor sees a one-time info alert at the top of the dashboard ("Your admin turned on time range limits: …" or "Your admin changed time range limits: …") with a **Got it** button. Editors are the users whose own user, roles or groups are listed as the dashboard's editors, plus any editors `EXTRA_EDITORS_RESOLVER` adds; admins see it only when one of these lists them. Viewers, embedded guests and standalone views (embedded dashboards, reports) don't see it, and loosening the limits shows nothing. **Got it** hides it and stores the global limits the editor acknowledged as one `key_value` row per editor (resource `app`, keyed by a UUID derived from the user id, no expiry), so the notice comes back only when the limits get stricter than that. The row names no user, so deleting the user still works and leaves the row behind; deleting a row only shows the notice to that editor again.
- **Dataset editor:** the **Settings** tab has the same section for the dataset, below the Basic and Advanced cards. It saves inside the dataset's `extra` with the rest of the dataset, and the **Extra** field doesn't show the `time_range_limits` key. A dataset with no time column shows its stored value, disabled, since there is nothing to limit.

## Guarded paths

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something, but export_as_example/?export_data=true isn't covered: as Gamma on the flag-on rig it returned whole tables. The route predates this PR, so maybe listing it as unguarded is enough. Or could it call check_datasource_open_query per dataset?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 97d8ccf and 593c074. With the flag on, the example export leaves out the data of any dataset a limit applies to, and the docs list it.

dashboard,
now,
[
(ranges, is_native or result_type == ChartDataResultType.SAMPLES)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is intended, but result_type: "samples" skips the unbounded check here. As Gamma, samples on birth_names with only ds < 1980-01-01 returned 25,736 rows from 1965 to 1979, while drill_detail got the 400. IIUC nothing in the UI sends this result type, so could the exemption go?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the exemption in cc918cc. A samples query without a time range answers 400.

Comment thread superset/commands/report/execute.py Outdated
def _limits_could_apply(chart: Slice, dashboard: Optional[Dashboard]) -> bool:
datasource = cast("Explorable", chart.resolved_datasource)
try:
temporal = datasource is None or has_temporal_column(datasource)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think counting datasource is None as temporal fails the whole dashboard report when one chart's dataset was deleted, with no retry, while with the flag off it renders. Could a chart with no datasource be skipped here, since it can't run a query anyway?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8fc36be. Charts with no dataset are skipped, so the report renders as it does with the flag off.

force: boolean,
key: string = ENTRY_KEY,
): Promise<ChartRangesEntry> {
const queryContext = await buildV1ChartDataPayload({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this build goes through the plugin's buildQuery, which remembers the last filters, so it uses up the table's reset to page 0. On page 3, a new time range sent row_offset: 20 (0 with the flag off) and showed "No results". Could Explore reuse this payload for the run, like the dashboard does?

explore-pagination-flag-on.mp4

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, final state in e5810c1 and 6085cb8. Reusing the payload broke when two checks ran before Update chart, so the check now has its own page-reset cache and the run builds its query as it does without the flag. The table goes back to page 0.

@@ -238,6 +256,7 @@ class DashboardJSONMetadataSchema(Schema):
allow_none=True,
validate=OneOf(["default", "force_on", "force_off"]),
)
time_range_limits = fields.Raw(allow_none=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the flag off this now stores any value, where master answers 400 "Unknown field". A "junk" value saved that way turns the dashboard's charts into 503s once the flag is on. Would a structural check without the flag make sense, e.g. parse_time_range_limits(check_units=False)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in fd61cfa, as you suggested. With the flag off, writes and imports check the shape with parse_time_range_limits(check_units=False): a value that isn't a policy object gets 400 on writes and 422 on imports.

Comment thread superset/datasource/api.py Outdated
@@ -331,6 +340,17 @@ def get_column_values(
except SupersetSecurityException as ex:
return self.response(403, message=ex.message)

try:
check_datasource_open_query(datasource)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this one is intended: with any rule set, this refuses the column values of every temporal dataset, so the Explore filter value dropdown lists nothing (4 regions with the flag off). Native Select filter option queries may run open, and this is the same kind of query. Could it get the same exemption?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, done in 996b3b6. Column values are exempt like native Select options, so the Explore dropdown loads again.

return self.response_403()
try:
with limit_scope(dashboard_id=dash.id):
DashboardDAO.prefetch_chart_access(dash)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the prefetch runs before dash.slices is loaded, so nothing holds those rows and each can_access_chart below loads the chart's editors and viewers again. The dashboard GET avoids it by loading the slices first, as get_charts_for_dashboard notes. Would reading slices = dash.slices before the prefetch work here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 647b508. The slices are loaded before the prefetch, so the access check reuses them. There's a test for it.

ranges.append((None, None, None, None, ()))

if query_object.time_offsets:
ranges.extend(_time_offset_ranges(query_object, filters))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comparison base can differ from the SQL's when chart Jinja removes a filter. With no time_range and the last temporal filter removed by get_time_filter(..., remove_filter=True), this reads the base from the copy, while processing_time_offsets uses the removed filter's value. Could the base come from the original query object here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7e2caab, test in 6303d2e. The base comes from the original query object, as in processing_time_offsets.

Comment thread UPDATING.md
is not cached. Engines whose cancel id only exists once a query is running,
such as Trino, still cannot cancel chart-data queries: their tasks stay
non-abortable, as before.
- Run `superset init` after upgrading to create the time range limits API and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe worth a line on rolling back. A build without this PR answers 400 "Unknown field" for json_metadata.time_range_limits, so after a rollback, saving a dashboard that has limits fails with "Invalid input" until the key is removed (tried it on master).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a rollback paragraph to UPDATING in ad9e66f.

…hanges

Master refuses time comparisons on semantic views before any other check,
so the limit tests for such comparisons now assert that refusal instead.
A bad range in a comparison's re-shifted filter is reported as a
QueryObjectValidationError, and the async eligibility test sets the
limit value-list window its MagicMock would otherwise leave truthy.
With limits on, the picker shows its own actual time range row, so the empty range warning master added for the default row never appeared. The row now shows the same warning when the current draft's check resolved both bounds to the same instant. The limit check and Apply are unchanged.
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Nov 20, 2026

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DamianPendrak, and thanks @geido and @msyavuz for the really thorough passes already.

I think this one needs a SIP before it can go much further. It's well over 18k lines of non-test changes (plus ~53k lines of tests and fixtures), and it reaches into the chart data path, reports, async workers, Jinja macros, importers, saved dashboard and dataset metadata, a new permission and an admin page. I couldn't find a SIP or a dev@ mailing list thread for it, but holler if I missed one. A couple of the recent thread replies also mention a "product decision"... it'd be great for calls like that to happen somewhere the community can weigh in, and a SIP is the place for it. Happy to help with the process.

Once there's agreement on the approach, I'd love to see this land as a series of smaller PRs (e.g. policy and enforcement on the backend first, then Explore, then dashboards). I don't think anyone can meaningfully review this much in one go.

Also, sharded-frontend-tests is failing on the new ExploreViewContainer.timeRangeLimits.focus.test.tsx (the Retry focus case).

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Nov 21, 2026
A successful policy refresh was judged by the previous check’s
unavailable result, so the focus intent was dropped.
Reuse the copy clamp for inherited import rules and fit native time defaults after attaching the imported charts.
Copies also refuse a clamp that would leave both look-back and look-forward at zero.
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Nov 23, 2026
…ashboard

A dashboard report's time range value now uses the limits of the
dashboard's own filter bar: the dashboard's time range limits and the
datasets of the charts in the filter's scope that the report renders,
loaded from the existing dashboard endpoints. The rendered charts follow
the tab and anchor rule the save check uses; a shared fixture runs the
same cases through both. With limits on, the picker hides "No filter",
shows the limit line and refuses an out-of-limit draft, and a stored
value that breaks the limits is flagged under the field with the filter
bar's text. Limits that can't be loaded or come back incomplete, a
dataset policy that failed and a rendered chart without a known
datasource show the dashboard's unavailable alert with Retry instead of
the picker. Each time filter row gets its own picker name. Alerts, and
the flag off, keep the picker as it was.

A refused save gives each reason once. The 422 keeps its shape
({"message": {"extra": [...]}}); the reason alone when every chart in
scope gives the same one, else each reason after the names of its charts.
@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Nov 23, 2026
… import

A dashboard copy or import whose time ranges no longer fit the time range limits now stores nothing and answers 422 with the list of changes it would make: stale dashboard rules rewritten to the admin limit and Time Range filter defaults fitted to the limits. Save as and the dashboard import dialog show the list and offer to adjust or cancel. API callers apply the listed changes by sending the request again with adjust_time_ranges set to true; the CLI import commands take --adjust-time-ranges. The applied changes are the listed ones, computed by the same code. With the feature flag off nothing changes.
…ng dashboard

The first import over an existing dashboard fits its stale rule to the admin
limit, so the next import of the same file differed from the stored value and
was refused. An import over an existing dashboard, live or archived, matched by
UUID or slug, now fits every rule looser than the admin limit and asks for
consent, also when the dashboard has no stored rule. An import that creates a
new dashboard still refuses a looser rule. The legacy importer does the same.
…ect list

A numeric Range filter's min and max query read all the data. It now reads the
same window as a Select filter's option list when it has no time range of its
own, and a range it carries is kept and checked as before.
The "Pre-filter available values" time range picker in filter settings ignored
the time range limits. It now gets the limits like a Time Range filter's
default: it offers no "No filter", and a range past the limits shows the
reason under the field and blocks Save.
…t renders

A triggered alert that attaches a chart or dashboard rendered it without the
time range check reports get, so a PNG alert stayed in Working and a CSV alert
failed with a generic message. The alert now runs the same check before it
renders and fails with the same reason. An alert that doesn't trigger, or that
attaches nothing, isn't checked.
@github-actions github-actions Bot added the risk:db-migration PRs that require a DB migration label Nov 26, 2026
…a/p1-kuz-150

# Conflicts:
#	tests/unit_tests/datasets/commands/importers/v1/import_test.py
#	tests/unit_tests/views/datasource/views_test.py
…cleanup

Removing a native filter drops its id from the dependent filters, which the
MCP tool then sends as modified. The time range limits check refused the
whole removal when such a dependent Time Range filter held a default the
current limits no longer allow, though its default was unchanged.
Flattening the Range filter suite off describe left the required range
cascade clear test inside the test above it, so Jest fails the outer test
with "Tests cannot be nested". Close the outer test before it, as the two
were siblings inside the describe.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API doc Namespace | Anything related to documentation i18n Namespace | Anything related to localization packages plugins requires:rebase Requires rebasing on top of current master risk:chart-metadata risk:db-migration PRs that require a DB migration size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants