You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2025/11/07 10:59:27 UTC

(superset) 03/03: test: test the fix

This is an automated email from the ASF dual-hosted git repository.

msyavuz pushed a commit to branch msyavuz/fix/timerange-timeshift-handling
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 3241c6b7afb61ff3297f3b44a77c17bd9eacceaa
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Fri Nov 7 13:59:05 2025 +0300

    test: test the fix
---
 tests/unit_tests/utils/date_parser_tests.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/unit_tests/utils/date_parser_tests.py b/tests/unit_tests/utils/date_parser_tests.py
index c44b36fc91..c5e6d512d3 100644
--- a/tests/unit_tests/utils/date_parser_tests.py
+++ b/tests/unit_tests/utils/date_parser_tests.py
@@ -271,6 +271,15 @@ def test_get_since_until() -> None:
     expected = datetime(1999, 12, 25), datetime(2017, 12, 25)
     assert result == expected
 
+    # Test time_shift with date range format (contains ' : ')
+    result = get_since_until(
+        time_range="today : tomorrow",
+        time_shift="yesterday : today",
+    )
+    # When time_shift contains ' : ', it should be parsed as a new time range
+    expected = datetime(2016, 11, 6), datetime(2016, 11, 7)
+    assert result == expected
+
     with pytest.raises(ValueError):  # noqa: PT011
         get_since_until(time_range="tomorrow : yesterday")