fix: Do not convert dataset changed_on to UTC (#33693)

This commit is contained in:
Vitor Avila
2025-06-04 22:24:18 -03:00
committed by GitHub
parent a26e1d822a
commit c9518485ba
2 changed files with 9 additions and 9 deletions

View File

@@ -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)

View File

@@ -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),
},
),
(