Skip to content

Commit 484901f

Browse files
authored
fix(pinot): typo in the name for epoch_ms_to_dttm (apache#26906)
1 parent 73d118c commit 484901f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

superset/db_engine_specs/pinot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def epoch_to_dttm(cls) -> str:
6262
)
6363

6464
@classmethod
65-
def epoch_ms_to_dttm_(cls) -> str:
65+
def epoch_ms_to_dttm(cls) -> str:
6666
return (
6767
"DATETIMECONVERT({col}, '1:MILLISECONDS:EPOCH', "
6868
+ "'1:MILLISECONDS:EPOCH', '1:MILLISECONDS')"

tests/integration_tests/db_engine_specs/pinot_tests.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@ def test_pinot_time_expression_sec_one_1m_grain(self):
8484
expected,
8585
)
8686

87+
def test_pinot_time_expression_millisec_one_1m_grain(self):
88+
col = column("tstamp")
89+
expr = PinotEngineSpec.get_timestamp_expr(col, "epoch_ms", "P1M")
90+
result = str(expr.compile())
91+
expected = (
92+
"CAST(DATE_TRUNC('month', CAST("
93+
+ "DATETIMECONVERT(tstamp, '1:MILLISECONDS:EPOCH', "
94+
+ "'1:MILLISECONDS:EPOCH', '1:MILLISECONDS') AS TIMESTAMP)) AS TIMESTAMP)"
95+
)
96+
self.assertEqual(
97+
result,
98+
expected,
99+
)
100+
87101
def test_invalid_get_time_expression_arguments(self):
88102
with self.assertRaises(NotImplementedError):
89103
PinotEngineSpec.get_timestamp_expr(column("tstamp"), None, "P0.25Y")

0 commit comments

Comments
 (0)