mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
fix: Do not convert dataset changed_on to UTC (#33693)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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),
|
||||
},
|
||||
),
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user