def test_include_too_many_missing_dates(self): # 0 - group by seconds params = P(column='Date', groupby='second', include_missing_dates=True) result = render(count_table, params) self.assertEqual( result, ('Including missing dates would create 174787201 rows, ' 'but the maximum allowed is 100'))
def _assertRendersTable(self, in_table, params, expected_table): result = render(in_table, params) if hasattr(expected_table["Date"], "dt"): # [adamhooper, 2019-04-03] This seems to say: "if we're in unit # tests, don't crash the way we crash on production" expected_table["Date"] = expected_table["Date"].dt.tz_localize( None) assert_frame_equal(result, expected_table)
def render(table, params): return ProcessResult.coerce(countbydate.render(table, params))
def test_mean_no_error_when_missing_target(self): params = P(column="Date", operation="mean", targetcolumn="") result = render(count_table, params) assert_frame_equal(result, count_table)
def test_no_col_gives_noop(self): result = render(count_table.copy(), P(column="")) assert_frame_equal(result, count_table)