def test_query_extension_processing( raw_data: dict, expected_conditions: Sequence[Condition], expected_granularity: int, ): state.set_config('max_days', 1) extension = TimeSeriesExtension( default_granularity=60, default_window=datetime.timedelta(days=5), timestamp_column='timestamp', ) valid_data = validate_jsonschema(raw_data, extension.get_schema()) query = Query( {"conditions": []}, TableSource("my_table", ColumnSet([])), ) request_settings = RequestSettings(turbo=False, consistent=False, debug=False) extension.get_processor().process_query(query, valid_data, request_settings) assert query.get_conditions() == expected_conditions assert query.get_granularity() == expected_granularity
def test_query_extension_processing(raw_data: dict, expected_conditions: Sequence[Condition]): state.set_config('max_days', 1) extension = TimeSeriesExtension( default_granularity=3600, default_window=datetime.timedelta(days=5), timestamp_column='timestamp', ) valid_data = validate_jsonschema(raw_data, extension.get_schema()) query = Query({"conditions": []}) extension.get_processor().process_query(query, valid_data) assert query.get_conditions() == expected_conditions
def get_extensions(self) -> Mapping[str, QueryExtension]: return { "timeseries": TimeSeriesExtension( default_granularity=3600, default_window=timedelta(days=7), timestamp_column="timestamp", ), "organization": OrganizationExtension(), }
def get_extensions(self) -> Mapping[str, QueryExtension]: return { 'performance': PerformanceExtension(), 'project': ProjectExtension(), 'timeseries': TimeSeriesExtension( default_granularity=3600, default_window=timedelta(days=5), timestamp_column='timestamp', ), }
def get_extensions(self) -> Mapping[str, QueryExtension]: return { "project": ProjectExtension( processor=ProjectExtensionProcessor(project_column="project_id") ), "timeseries": TimeSeriesExtension( default_granularity=3600, default_window=timedelta(days=5), timestamp_column="start_ts", ), }
def get_extensions(self) -> Mapping[str, QueryExtension]: return { 'project': ProjectExtension(processor=ProjectExtensionProcessor()), 'timeseries': TimeSeriesExtension( default_granularity=3600, default_window=timedelta(days=5), timestamp_column='start_ts', ), }
def test_query_extension_processing( raw_data: dict, expected_conditions: Sequence[Condition], expected_ast_condition: Expression, expected_granularity: int, ): state.set_config("max_days", 1) extension = TimeSeriesExtension( default_granularity=60, default_window=timedelta(days=5), timestamp_column="timestamp", ) valid_data = validate_jsonschema(raw_data, extension.get_schema()) query = Query({"conditions": []}, TableSource("my_table", ColumnSet([])),) request_settings = HTTPRequestSettings() extension.get_processor().process_query(query, valid_data, request_settings) assert query.get_conditions() == expected_conditions assert query.get_condition_from_ast() == expected_ast_condition assert query.get_granularity() == expected_granularity
def get_extensions(self) -> Mapping[str, QueryExtension]: return { 'project': ProjectExtension(processor=ProjectWithGroupsProcessor( project_column="events.project_id")), 'timeseries': TimeSeriesExtension( default_granularity=3600, default_window=timedelta(days=5), timestamp_column='events.timestamp', ), }
def get_extensions(self) -> Mapping[str, QueryExtension]: return { "project": ProjectExtension( processor=ProjectWithGroupsProcessor( project_column="events.project_id", replacer_state_name=None, ) ), "timeseries": TimeSeriesExtension( default_granularity=3600, default_window=timedelta(days=5), timestamp_column="events.timestamp", ), }