You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by va...@apache.org on 2025/06/05 01:24:26 UTC

(superset) branch master updated: fix: Do not convert dataset changed_on to UTC (#33693)

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

vavila pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c9518485ba fix: Do not convert dataset changed_on to UTC (#33693)
c9518485ba is described below

commit c9518485ba8d78be01a4e2372e1f3e068eabe38f
Author: Vitor Avila <96...@users.noreply.github.com>
AuthorDate: Wed Jun 4 22:24:18 2025 -0300

    fix: Do not convert dataset changed_on to UTC (#33693)
---
 superset/daos/dataset.py             |  4 ++--
 tests/unit_tests/dao/dataset_test.py | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/superset/daos/dataset.py b/superset/daos/dataset.py
index 20bd839612..5fbd012801 100644
--- a/superset/daos/dataset.py
+++ b/superset/daos/dataset.py
@@ -17,7 +17,7 @@
 from __future__ import annotations
 
 import logging
-from datetime import datetime, timezone
+from datetime import datetime
 from typing import Any
 
 import dateutil.parser
@@ -198,7 +198,7 @@ class DatasetDAO(BaseDAO[SqlaTable]):
                 force_update = True
 
             if force_update:
-                attributes["changed_on"] = datetime.now(tz=timezone.utc)
+                attributes["changed_on"] = datetime.now()
 
         return super().update(item, attributes)
 
diff --git a/tests/unit_tests/dao/dataset_test.py b/tests/unit_tests/dao/dataset_test.py
index aa603b7f93..cf66062b8a 100644
--- a/tests/unit_tests/dao/dataset_test.py
+++ b/tests/unit_tests/dao/dataset_test.py
@@ -16,7 +16,7 @@
 # under the License.
 
 import copy
-from datetime import datetime, timezone
+from datetime import datetime
 from typing import Any
 from unittest.mock import MagicMock, patch
 
@@ -99,7 +99,7 @@ def test_validate_update_uniqueness(session: Session) -> None:
                 "columns": [{"id": 1, "name": "col1"}],
                 "metrics": [{"id": 1, "name": "metric1"}],
             },
-            {"changed_on": datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc)},
+            {"changed_on": datetime(2025, 1, 1, 0, 0, 0)},
         ),
         (
             {
@@ -109,14 +109,14 @@ def test_validate_update_uniqueness(session: Session) -> None:
             },
             {
                 "description": "test description",
-                "changed_on": datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc),
+                "changed_on": datetime(2025, 1, 1, 0, 0, 0),
             },
         ),
         (
             {
                 "columns": [{"id": 1, "name": "col1"}],
             },
-            {"changed_on": datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc)},
+            {"changed_on": datetime(2025, 1, 1, 0, 0, 0)},
         ),
         (
             {
@@ -125,14 +125,14 @@ def test_validate_update_uniqueness(session: Session) -> None:
             },
             {
                 "description": "test description",
-                "changed_on": datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc),
+                "changed_on": datetime(2025, 1, 1, 0, 0, 0),
             },
         ),
         (
             {
                 "metrics": [{"id": 1, "name": "metric1"}],
             },
-            {"changed_on": datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc)},
+            {"changed_on": datetime(2025, 1, 1, 0, 0, 0)},
         ),
         (
             {
@@ -141,7 +141,7 @@ def test_validate_update_uniqueness(session: Session) -> None:
             },
             {
                 "description": "test description",
-                "changed_on": datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc),
+                "changed_on": datetime(2025, 1, 1, 0, 0, 0),
             },
         ),
         (