def test_event_count_5_sql(diff_reporter):
    """
    Event count query with hours spanning midnight returns the expected sql string.
    """
    ec = EventCount(start="2016-01-03", stop="2016-01-06", hours=(22, 4))
    sql = pretty_sql(ec.get_query())
    diff_reporter(sql)
def test_event_count_4_sql(diff_reporter):
    """
    Event count query with restricted hours returns the expected sql string.
    """
    ec = EventCount(start="2016-01-02", stop="2016-01-04", hours=(12, 18))
    sql = pretty_sql(ec.get_query())
    diff_reporter(sql)
def test_event_count_3_sql(diff_reporter):
    """
    Event count query with implicit start date returns the expected sql string.
    """
    ec = EventCount(start=None, stop="2016-01-02")
    sql = pretty_sql(ec.get_query())
    diff_reporter(sql)
def test_event_count_5_df(get_dataframe, diff_reporter):
    """
    Event count query with hours spanning modnight returns the expected data.
    """
    ec = EventCount(start="2016-01-03", stop="2016-01-06", hours=(22, 4))
    df = get_dataframe(ec)
    diff_reporter(df.to_csv())
def test_event_count_4_df(get_dataframe, diff_reporter):
    """
    Event count query with restricted hours returns the expected data.
    """
    ec = EventCount(start="2016-01-02", stop="2016-01-04", hours=(12, 18))
    df = get_dataframe(ec)
    diff_reporter(df.to_csv())
def test_event_count_3_df(get_dataframe, diff_reporter):
    """
    Event count query with implicit start date returns the expected data.
    """
    ec = EventCount(start=None, stop="2016-01-02")
    df = get_dataframe(ec)
    diff_reporter(df.to_csv())
예제 #7
0
    def _unsampled_query_obj(self):
        """
        Return the underlying flowmachine event_count object.

        Returns
        -------
        Query
        """
        return EventCount(
            start=self.start,
            stop=self.stop,
            direction=self.direction,
            tables=self.event_types,
            subscriber_subset=self.subscriber_subset,
        )