Skip to content

Commit

Permalink
Update snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Nov 9, 2024
1 parent 6127f82 commit 455a1ef
Show file tree
Hide file tree
Showing 3,304 changed files with 14,545 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_ambiguous_entity_path_resolves_to_shortest_entity_path_item
test_filename: test_ambiguous_entity_path.py
docstring:
Tests that 'entity_1__country' resolves to 'entity_1__country' not 'entity_1__entity_0__country'.
---
MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='all_entity_metric', filter_spec_set=WhereFilterSpecSet()),),
dimension_specs=(DimensionSpec(element_name='country', entity_links=(EntityReference(element_name='entity_1'),)),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_resolvable_ambiguous_entity_path
test_filename: test_ambiguous_entity_path.py
---
MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='entity_1_metric', filter_spec_set=WhereFilterSpecSet()),),
dimension_specs=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
test_name: test_non_resolvable_ambiguous_entity_path_due_to_mismatch
test_filename: test_ambiguous_entity_path.py
docstring:
Tests an input with an ambiguous entity-path that can't be resolved due to a mismatch between metrics.

'entity_0__country' matches ['entity_1__entity_0__country', 'entity_0__country']
---
Got errors while resolving the query.

Error #1:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
test_name: test_non_resolvable_ambiguous_entity_path_due_to_multiple_matches
test_filename: test_ambiguous_entity_path.py
docstring:
Tests an input with an ambiguous entity-path that can't be resolved due to multiple matches.

'entity_0__country' matches ['entity_1__entity_0__country', 'entity_2__entity_0__country']
---
Got errors while resolving the query.

Error #1:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_available_group_by_items[accumulate_last_2_months_metric]
test_filename: test_available_group_by_items.py
---
[
"TimeDimension('metric_time', 'month')",
"TimeDimension('metric_time', 'quarter')",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
test_name: test_available_group_by_items[derived_metric_with_different_parent_time_grains]
test_filename: test_available_group_by_items.py
---
["TimeDimension('metric_time', 'year')", "TimeDimension('metric_time', 'year', date_part_name='year')"]
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_available_group_by_items[derived_metric_with_same_parent_time_grains]
test_filename: test_available_group_by_items.py
---
[
"TimeDimension('metric_time', 'month')",
"TimeDimension('metric_time', 'month', date_part_name='month')",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
test_name: test_available_group_by_items[metrics_with_different_time_grains]
test_filename: test_available_group_by_items.py
---
["TimeDimension('metric_time', 'year')", "TimeDimension('metric_time', 'year', date_part_name='year')"]
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_available_group_by_items[metrics_with_same_time_grains]
test_filename: test_available_group_by_items.py
---
[
"TimeDimension('metric_time', 'month')",
"TimeDimension('metric_time', 'month', date_part_name='month')",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_available_group_by_items[no_metrics]
test_filename: test_available_group_by_items.py
---
[
"TimeDimension('metric_time', 'day')",
"TimeDimension('metric_time', 'day', date_part_name='day')",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_available_group_by_items[simple_metric]
test_filename: test_available_group_by_items.py
---
[
"TimeDimension('metric_time', 'month')",
"TimeDimension('metric_time', 'month', date_part_name='month')",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_conversion_rate_with_constant_properties
test_filename: test_conversion_metrics.py
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
test_name: test_get_invariant
test_filename: test_dimension_lookup.py
docstring:
Test invariants for all dimensions.

Uses `partitioned_multi_hop_join_semantic_manifest` to show an example of different `is_partition` values.
---
{
'account_month': DimensionInvariant(dimension_type=CATEGORICAL, is_partition=False),
'acquired_ds': DimensionInvariant(dimension_type=TIME, is_partition=False),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
test_name: test_linkable_element_set_as_spec_set
test_filename: test_linkable_spec_resolver.py
docstring:
Tests extracting linkable elements for a given measure input and converting them into a spec set.

Note assert_spec_set_snapshot_equal relies on an InstanceSpecSet, not a LinkableSpecSet, so we have to
double up on the .as_spec_set calls here. Yes, this is lazy. No, I don't care to make another helper to
do snapshot comparisons on LinkableSpecSets.
---
[
'listing',
'listing__active_listings',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_all_properties
test_filename: test_linkable_spec_resolver.py
---
Model Join-Path Entity Links Name Time Granularity Date Part Properties
--------------------------------------------------------- ------------------- -------------------- ------------------ ----------- ----------------------------------------------------------------
('bookings_source',) () listing ['ENTITY', 'LOCAL']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_create_linkable_element_set_from_join_path
test_filename: test_linkable_spec_resolver.py
---
Model Join-Path Entity Links Name Time Granularity Date Part Properties
-------------------------------------- -------------- --------------- ------------------ ----------- ---------------------------------------------------
('bookings_source', 'listings_latest') ('listing',) capacity_latest ['JOINED']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_create_linkable_element_set_from_join_path_multi_hop
test_filename: test_linkable_spec_resolver.py
---
Model Join-Path Entity Links Name Time Granularity Date Part Properties
------------------------------------------------------ -------------------- --------------- ------------------ ----------- ----------------------------------------------------------------
('views_source', 'bookings_source', 'listings_latest') ('guest', 'listing') capacity_latest ['JOINED', 'MULTI_HOP']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_cyclic_join_manifest
test_filename: test_linkable_spec_resolver.py
---
Model Join-Path Entity Links Name Time Granularity Date Part Properties
--------------------------------------------- ------------------ --------------- ------------------ ----------- --------------------------------------------------------
('listings_latest',) () cyclic_entity ['ENTITY', 'LOCAL']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_metric_time_property_for_cumulative_metric
test_filename: test_linkable_spec_resolver.py
---
Model Join-Path Entity Links Name Time Granularity Date Part Properties
----------------- -------------- ----------- ------------------ ----------- -------------------------------------------
('revenue',) () metric_time day ['METRIC_TIME']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_metric_time_property_for_derived_metrics
test_filename: test_linkable_spec_resolver.py
---
Model Join-Path Entity Links Name Time Granularity Date Part Properties
-------------------- -------------- ----------- ------------------ ----------- --------------------------------------------------------
('bookings_source',) () metric_time day ['METRIC_TIME']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_one_property
test_filename: test_linkable_spec_resolver.py
---
Model Join-Path Entity Links Name Time Granularity Date Part Properties
-------------------- -------------- ------- ------------------ ----------- -------------------
('bookings_source',) () listing ['ENTITY', 'LOCAL']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_ambiguous_metric_time_in_query_filter[accumulate_last_2_months_metric]
test_filename: test_matching_item_for_filters.py
---
GroupByItemResolution(
spec=TimeDimensionSpec(
element_name='metric_time',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_ambiguous_metric_time_in_query_filter[derived_metric_with_different_parent_time_grains]
test_filename: test_matching_item_for_filters.py
---
GroupByItemResolution(
spec=TimeDimensionSpec(
element_name='metric_time',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_ambiguous_metric_time_in_query_filter[derived_metric_with_same_parent_time_grains]
test_filename: test_matching_item_for_filters.py
---
GroupByItemResolution(
spec=TimeDimensionSpec(
element_name='metric_time',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_ambiguous_metric_time_in_query_filter[metrics_with_different_time_grains]
test_filename: test_matching_item_for_filters.py
---
GroupByItemResolution(
spec=TimeDimensionSpec(
element_name='metric_time',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_ambiguous_metric_time_in_query_filter[metrics_with_same_time_grains]
test_filename: test_matching_item_for_filters.py
---
GroupByItemResolution(
spec=TimeDimensionSpec(
element_name='metric_time',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_ambiguous_metric_time_in_query_filter[no_metrics]
test_filename: test_matching_item_for_filters.py
---
GroupByItemResolution(
spec=TimeDimensionSpec(
element_name='metric_time',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_ambiguous_metric_time_in_query_filter[simple_metric]
test_filename: test_matching_item_for_filters.py
---
GroupByItemResolution(
spec=TimeDimensionSpec(
element_name='metric_time',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
test_name: test_missing_parent_for_metric
test_filename: test_matching_item_for_querying.py
docstring:
Tests a search for a group by item with a metric stub with no parents.

We operate under the logical assumption that metric and query items have parent nodes - for a query,
these are the inputs (group by items, metrics, etc.). For metrics, these are the metric inputs (metrics
or measures). However, in the event of a validation gap upstream, we sometimes encounter inscrutable errors
caused by missing parent nodes for these input types, so we add a more informative error and test for it here.
---
AvailableGroupByItemsResolution(
issue_set=MetricFlowQueryResolutionIssueSet(
issues=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_invalid_group_by_item
test_filename: test_matching_item_for_querying.py
---
GroupByItemResolution(
linkable_element_set=LinkableElementSet(),
issue_set=MetricFlowQueryResolutionIssueSet(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_unavailable_group_by_item_in_derived_metric_parent
test_filename: test_matching_item_for_querying.py
docstring:
Tests a group-by-item that's only available in one of the parent metrics of a derived metric.
---
GroupByItemResolution(
linkable_element_set=LinkableElementSet(),
issue_set=MetricFlowQueryResolutionIssueSet(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_measure_properties
test_filename: test_measure_lookup.py
docstring:
Test a couple of measures for correct properties.
---
{
'bookings': MeasureRelationshipPropertySet(
model_reference=SemanticModelReference(semantic_model_name='extended_bookings_source'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_derived_metric_with_defined_metric_time_filter
test_filename: test_metric_time_granularity.py
docstring:
Tests that a derived metric's metric_time filter defined in its YAML uses outer metric's default granularity.
---
MetricFlowQuerySpec(
metric_specs=(
MetricSpec(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
test_name: test_derived_metric_with_defined_metric_time_filter_on_input_metric
test_filename: test_metric_time_granularity.py
docstring:
Tests a derived metric with a metric_time filter on its input metric.

Should use the outer metric's default granularity.
Should always use the default granularity for the object where the filter is defined.
---
MetricFlowQuerySpec(
metric_specs=(
MetricSpec(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_derived_metric_with_explicit_time_granularity
test_filename: test_metric_time_granularity.py
docstring:
Tests that a derived metric with default granularity ignores the default granularities set on its input metrics.
---
MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='derived_metric_with_time_granularity', filter_spec_set=WhereFilterSpecSet()),),
time_dimension_specs=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
test_name: test_derived_metric_without_explicit_time_granularity
test_filename: test_metric_time_granularity.py
docstring:
Tests a derived metric without explicit default granularity.

Should ignore the default granularities set on its input metrics.
---
MetricFlowQuerySpec(
metric_specs=(
MetricSpec(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_non_metric_time_ignores_default_granularity
test_filename: test_metric_time_granularity.py
---
MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='largest_listing', filter_spec_set=WhereFilterSpecSet()),),
time_dimension_specs=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_simple_metric_with_defined_metric_time_filter
test_filename: test_metric_time_granularity.py
docstring:
Tests that a simple metric's metric_time filter defined in its YAML uses metric's default granularity.
---
MetricFlowQuerySpec(
metric_specs=(
MetricSpec(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_simple_metric_with_explicit_time_granularity
test_filename: test_metric_time_granularity.py
---
MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='largest_listing', filter_spec_set=WhereFilterSpecSet()),),
time_dimension_specs=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_simple_metric_without_explicit_time_granularity
test_filename: test_metric_time_granularity.py
docstring:
Tests that a metric without default granularity uses the min granualrity for its agg_time_dim.
---
MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='monthly_metric_0', filter_spec_set=WhereFilterSpecSet()),),
time_dimension_specs=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_cumulative_metric_agg_time_dimension_name_validation
test_filename: test_query_parser.py
docstring:
Test that queries for cumulative metrics succeed if the agg_time_dimension is selected by name.
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='revenue_cumulative', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_derived_metric_with_offset_parsing
test_filename: test_query_parser.py
docstring:
Test that querying derived metrics with a time offset requires a time dimension.
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='revenue_growth_2_weeks', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
test_name: test_order_by_granularity_conversion
test_filename: test_query_parser.py
docstring:
Test that the granularity of the primary time dimension in the order by is returned appropriately.

In the case where the primary time dimension is specified in the order by without a granularity suffix, the order
by spec returned by the parser should have a granularity appropriate for the queried metrics.
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_order_by_granularity_no_conversion
test_filename: test_query_parser.py
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
test_name: test_parse_and_validate_where_constraint_dims
test_filename: test_query_parser.py
docstring:
Test that the returned time constraint in the query spec is adjusted to match the granularity of the query.
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_query_parser
test_filename: test_query_parser.py
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_query_parser_case_insensitivity_with_names
test_filename: test_query_parser.py
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_query_parser_case_insensitivity_with_parameter_objects
test_filename: test_query_parser.py
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
test_name: test_query_parser_with_object_params
test_filename: test_query_parser.py
---
ParseQueryResult(
query_spec=MetricFlowQuerySpec(
metric_specs=(MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()),),
Expand Down
Loading

0 comments on commit 455a1ef

Please sign in to comment.