You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/02/10 17:49:58 UTC
[GitHub] [incubator-superset] willbarrett commented on a change in pull
request #9107: feat: add rolling window support to 'Big Number with
Trendline' viz
willbarrett commented on a change in pull request #9107: feat: add rolling window support to 'Big Number with Trendline' viz
URL: https://github.com/apache/incubator-superset/pull/9107#discussion_r377218500
##########
File path: tests/viz_tests.py
##########
@@ -1163,3 +1163,26 @@ def test_process_data_resample(self):
.tolist(),
[1.0, 2.0, np.nan, np.nan, 5.0, np.nan, 7.0],
)
+
+ def test_apply_roling(self):
+ datasource = self.get_datasource_mock()
+ df = pd.DataFrame(
+ index=pd.to_datetime(
+ ["2019-01-01", "2019-01-02", "2019-01-05", "2019-01-07"]
+ ),
+ data={"y": [1.0, 1.0, 1.0, 1.0]},
+ )
+ self.assertEqual(
+ viz.BigNumberViz(
+ datasource,
+ {
+ "metrics": ["y"],
+ "rolling_type": "cumsum",
Review comment:
It would be good to test the other `rolling_type` values - this is only testing one branch of a nested `if` statement.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org