Skip to content

fix(semantic layers): start/end ranges#41590

Merged
rusackas merged 2 commits into
masterfrom
sl-time-range
Jul 4, 2026
Merged

fix(semantic layers): start/end ranges#41590
rusackas merged 2 commits into
masterfrom
sl-time-range

Conversation

@betodealmeida

Copy link
Copy Markdown
Member

SUMMARY

Use get_since_until_from_time_range to split start/end from a time range when exploring a semantic view.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.42%. Comparing base (7f4cac6) to head (6b201cb).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41590      +/-   ##
==========================================
- Coverage   64.45%   64.42%   -0.04%     
==========================================
  Files        2670     2668       -2     
  Lines      147340   147252      -88     
  Branches    33988    33960      -28     
==========================================
- Hits        94966    94864     -102     
- Misses      50647    50659      +12     
- Partials     1727     1729       +2     
Flag Coverage Δ
hive 39.07% <25.00%> (ø)
mysql 57.67% <25.00%> (ø)
postgres 57.73% <25.00%> (-0.01%) ⬇️
presto 40.62% <25.00%> (ø)
python 59.14% <100.00%> (-0.01%) ⬇️
sqlite 57.32% <25.00%> (ø)
unit 100.00% <100.00%> (ø)

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.

@betodealmeida
betodealmeida marked this pull request as ready for review June 30, 2026 23:32
@dosubot dosubot Bot added the explore:time Related to the time filters in Explore label Jun 30, 2026
@github-actions

This comment was marked as low quality.

@bito-code-review

bito-code-review Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #9c15bc

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: f9149eb..f9149eb
    • superset/semantic_layers/mapper.py
    • tests/unit_tests/semantic_layers/mapper_test.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rebenitez1802 rebenitez1802 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs rebase, LGTM

Comment thread superset/semantic_layers/mapper.py
@bito-code-review

Copy link
Copy Markdown
Contributor

The suggestion to add explicit type annotations to the temporal boundary variables is correct, as it improves code clarity and adheres to strict typing standards. You can resolve this by explicitly annotating the start and end variables returned by get_since_until_from_time_range.

Here is the corrected implementation for superset/semantic_layers/mapper.py:

        start: datetime | None
        end: datetime | None
        start, end = get_since_until_from_time_range(time_range=value)

There are no other comments on this PR to address. Would you like me to review any other parts of the code?

superset/semantic_layers/mapper.py

start: datetime | None
        end: datetime | None
        start, end = get_since_until_from_time_range(time_range=value)

@mikebridge mikebridge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Correct, well-tested fix — named time ranges ("Last week", etc.) no longer raise ValueError, and delegating to the canonical get_since_until_from_time_range parser keeps this path aligned with the rest of Superset's time handling. Nicely covered by the parametrized regression test. Approving.

Optional: a one-line docstring on get_since_until_from_time_range would be worth adding now that it's a shared entry point.

This review was generated by Claude (AI) on behalf of @mikebridge.

@mikebridge mikebridge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving — LGTM. Any notes in my earlier review are non-blocking.

This review was generated by Claude (AI) on behalf of @mikebridge.

@rusackas
rusackas merged commit 8fcc0f8 into master Jul 4, 2026
59 checks passed
@rusackas
rusackas deleted the sl-time-range branch July 4, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

explore:time Related to the time filters in Explore size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants