Skip to content

Commit

Permalink
interpol test case work
Browse files Browse the repository at this point in the history
  • Loading branch information
R7L208 committed Jul 8, 2024
1 parent a46dd39 commit 1bb8383
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/tests/tsdf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,14 @@ def test_withPartitionCols(self):
self.assertEqual(init_tsdf.partitionCols, [])
self.assertEqual(actual_tsdf.partitionCols, ["symbol"])

def test_tsdf_interpolate(self): ...
# def test_tsdf_interpolate(self):
# # TODO: wicked slow
# init_tsdf = self.get_test_df_builder("init").as_tsdf()
# expected_tsdf = self.get_test_df_builder("expected").as_tsdf()
#
# actual_tsdf = init_tsdf.interpolate("zero", "minute", "floor")
#
# self.assertDataFrameEquality(actual_tsdf, expected_tsdf)


class FourierTransformTest(SparkTest):
Expand Down
35 changes: 35 additions & 0 deletions python/tests/unit_test_data/tsdf_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,41 @@
}
}
}
},
"test_tsdf_interpolate": {
"init": {
"tsdf": {
"ts_col": "event_ts"
},
"df": {
"schema": "symbol string, event_ts string, trade_pr float",
"ts_convert": [
"event_ts"
],
"data": {
"$ref": "#/__SharedData/temp_slice_init_data/df/data"
}
}
},
"expected": {
"tsdf": {
"ts_col": "event_ts"
},
"df": {
"schema": "event_ts string, trade_pr float",
"ts_convert": [
"event_ts"
],
"data": [
["2020-09-01 00:20:38", 0.0],
["2020-09-01 00:20:39", 0.0],
["2020-09-01 00:20:40", 0.0],
["2020-09-01 00:20:41", 0.0],
["2020-09-01 00:20:42", 762.33]
]
}

}
}
},
"FourierTransformTest": {
Expand Down

0 comments on commit 1bb8383

Please sign in to comment.