-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
279 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...py/ParseQueryResult/test_cumulative_metric_agg_time_dimension_name_validation__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='revenue_cumulative'),), | ||
time_dimension_specs=( | ||
TimeDimensionSpec( | ||
element_name='ds', | ||
entity_links=(EntityReference(element_name='revenue_instance'),), | ||
time_granularity=MONTH, | ||
), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='revenue_source'),), | ||
) |
10 changes: 10 additions & 0 deletions
10
...test_query_parser.py/ParseQueryResult/test_derived_metric_with_offset_parsing__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='revenue_growth_2_weeks'),), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='revenue_source'),), | ||
) |
19 changes: 19 additions & 0 deletions
19
...ts/test_query_parser.py/ParseQueryResult/test_order_by_granularity_conversion__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'), MetricSpec(element_name='revenue')), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),), | ||
order_by_specs=( | ||
OrderBySpec( | ||
instance_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH), | ||
descending=True, | ||
), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=( | ||
SemanticModelReference(semantic_model_name='bookings_source'), | ||
SemanticModelReference(semantic_model_name='revenue_source'), | ||
), | ||
) |
16 changes: 16 additions & 0 deletions
16
...test_query_parser.py/ParseQueryResult/test_order_by_granularity_no_conversion__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'),), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=DAY),), | ||
order_by_specs=( | ||
OrderBySpec( | ||
instance_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=DAY), | ||
descending=False, | ||
), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='bookings_source'),), | ||
) |
105 changes: 105 additions & 0 deletions
105
...uery_parser.py/ParseQueryResult/test_parse_and_validate_where_constraint_dims__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'),), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=DAY),), | ||
time_range_constraint=TimeRangeConstraint( | ||
start_time=datetime.datetime(2020, 1, 15, 0, 0), | ||
end_time=datetime.datetime(2020, 2, 15, 0, 0), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection( | ||
where_filters=[ | ||
PydanticWhereFilter( | ||
where_sql_template="{{ Dimension('booking__is_instant') }} = '1'", | ||
), | ||
], | ||
), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp( | ||
spec_resolutions=( | ||
FilterSpecResolution( | ||
lookup_key=ResolvedSpecLookUpKey( | ||
filter_location=WhereFilterLocation( | ||
metric_references=( | ||
MetricReference( | ||
element_name='bookings', | ||
), | ||
), | ||
), | ||
call_parameter_set=DimensionCallParameterSet( | ||
entity_path=( | ||
EntityReference( | ||
element_name='booking', | ||
), | ||
), | ||
dimension_reference=DimensionReference( | ||
element_name='is_instant', | ||
), | ||
), | ||
), | ||
where_filter_intersection=PydanticWhereFilterIntersection( | ||
where_filters=[ | ||
PydanticWhereFilter( | ||
where_sql_template="{{ Dimension('booking__is_instant') }} = '1'", | ||
), | ||
], | ||
), | ||
resolved_linkable_element_set=LinkableElementSet( | ||
path_key_to_linkable_dimensions={ | ||
ElementPathKey( | ||
element_name='is_instant', | ||
element_type=DIMENSION, | ||
entity_links=( | ||
EntityReference( | ||
element_name='booking', | ||
), | ||
), | ||
): ( | ||
LinkableDimension( | ||
semantic_model_origin=SemanticModelReference( | ||
semantic_model_name='bookings_source', | ||
), | ||
element_name='is_instant', | ||
dimension_type=CATEGORICAL, | ||
entity_links=( | ||
EntityReference( | ||
element_name='booking', | ||
), | ||
), | ||
join_path=SemanticModelJoinPath( | ||
left_semantic_model_reference=SemanticModelReference( | ||
semantic_model_name='bookings_source', | ||
), | ||
), | ||
properties=frozenset( | ||
'LOCAL', | ||
), | ||
), | ||
), | ||
}, | ||
), | ||
spec_pattern=DimensionPattern( | ||
parameter_set=EntityLinkPatternParameterSet( | ||
fields_to_compare=( | ||
ELEMENT_NAME, | ||
ENTITY_LINKS, | ||
), | ||
element_name='is_instant', | ||
entity_links=( | ||
EntityReference( | ||
element_name='booking', | ||
), | ||
), | ||
), | ||
), | ||
filter_location_path=MetricFlowQueryResolutionPath( | ||
resolution_path_nodes=( | ||
QueryGroupByItemResolutionNode(node_id=qr_5), | ||
), | ||
), | ||
object_builder_str="Dimension('booking__is_instant')", | ||
), | ||
), | ||
), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='bookings_source'),), | ||
) |
24 changes: 24 additions & 0 deletions
24
...w_semantics/snapshots/test_query_parser.py/ParseQueryResult/test_query_parser__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'),), | ||
dimension_specs=( | ||
DimensionSpec( | ||
element_name='is_instant', | ||
entity_links=(EntityReference(element_name='booking'),), | ||
), | ||
), | ||
entity_specs=(EntitySpec(element_name='listing'),), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=DAY),), | ||
order_by_specs=( | ||
OrderBySpec( | ||
instance_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=DAY), | ||
descending=False, | ||
), | ||
OrderBySpec(instance_spec=MetricSpec(element_name='bookings'), descending=True), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='bookings_source'),), | ||
) |
24 changes: 24 additions & 0 deletions
24
...ry_parser.py/ParseQueryResult/test_query_parser_case_insensitivity_with_names__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'),), | ||
dimension_specs=( | ||
DimensionSpec( | ||
element_name='is_instant', | ||
entity_links=(EntityReference(element_name='booking'),), | ||
), | ||
), | ||
entity_specs=(EntitySpec(element_name='listing'),), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=DAY),), | ||
order_by_specs=( | ||
OrderBySpec( | ||
instance_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=DAY), | ||
descending=False, | ||
), | ||
OrderBySpec(instance_spec=MetricSpec(element_name='bookings'), descending=True), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='bookings_source'),), | ||
) |
24 changes: 24 additions & 0 deletions
24
.../ParseQueryResult/test_query_parser_case_insensitivity_with_parameter_objects__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'),), | ||
dimension_specs=( | ||
DimensionSpec( | ||
element_name='is_instant', | ||
entity_links=(EntityReference(element_name='booking'),), | ||
), | ||
), | ||
entity_specs=(EntitySpec(element_name='listing'),), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=DAY),), | ||
order_by_specs=( | ||
OrderBySpec( | ||
instance_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=DAY), | ||
descending=False, | ||
), | ||
OrderBySpec(instance_spec=MetricSpec(element_name='bookings'), descending=True), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='bookings_source'),), | ||
) |
24 changes: 24 additions & 0 deletions
24
...ts/test_query_parser.py/ParseQueryResult/test_query_parser_with_object_params__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'),), | ||
dimension_specs=( | ||
DimensionSpec( | ||
element_name='is_instant', | ||
entity_links=(EntityReference(element_name='booking'),), | ||
), | ||
), | ||
entity_specs=(EntitySpec(element_name='listing'),), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=DAY),), | ||
order_by_specs=( | ||
OrderBySpec( | ||
instance_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=DAY), | ||
descending=False, | ||
), | ||
OrderBySpec(instance_spec=MetricSpec(element_name='bookings'), descending=True), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=(SemanticModelReference(semantic_model_name='bookings_source'),), | ||
) |
17 changes: 17 additions & 0 deletions
17
...s/test_query_parser.py/ParseQueryResult/test_time_range_constraint_conversion__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ParseQueryResult( | ||
query_spec=MetricFlowQuerySpec( | ||
metric_specs=(MetricSpec(element_name='bookings'), MetricSpec(element_name='revenue')), | ||
time_dimension_specs=(TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),), | ||
time_range_constraint=TimeRangeConstraint( | ||
start_time=datetime.datetime(2020, 1, 1, 0, 0), | ||
end_time=datetime.datetime(2020, 2, 29, 0, 0), | ||
), | ||
filter_intersection=PydanticWhereFilterIntersection(), | ||
filter_spec_resolution_lookup=FilterSpecResolutionLookUp(), | ||
min_max_only=False, | ||
), | ||
queried_semantic_models=( | ||
SemanticModelReference(semantic_model_name='bookings_source'), | ||
SemanticModelReference(semantic_model_name='revenue_source'), | ||
), | ||
) |