mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +00:00
fix: Time Offset in SQLite and refine logic in Date Type conversion (#21378)
This commit is contained in:
@@ -70,6 +70,7 @@ from superset.utils.core import (
|
||||
validate_json,
|
||||
zlib_compress,
|
||||
zlib_decompress,
|
||||
DateColumn,
|
||||
)
|
||||
from superset.utils.database import get_or_create_db
|
||||
from superset.utils import schema
|
||||
@@ -1062,7 +1063,18 @@ class TestUtils(SupersetTestCase):
|
||||
time_shift: Optional[timedelta],
|
||||
) -> pd.DataFrame:
|
||||
df = df.copy()
|
||||
normalize_dttm_col(df, timestamp_format, offset, time_shift)
|
||||
normalize_dttm_col(
|
||||
df,
|
||||
tuple(
|
||||
[
|
||||
DateColumn.get_legacy_time_column(
|
||||
timestamp_format=timestamp_format,
|
||||
offset=offset,
|
||||
time_shift=time_shift,
|
||||
)
|
||||
]
|
||||
),
|
||||
)
|
||||
return df
|
||||
|
||||
ts = pd.Timestamp(2021, 2, 15, 19, 0, 0, 0)
|
||||
|
||||
Reference in New Issue
Block a user