Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jul 9, 2024
1 parent 56e3990 commit 0c1d3ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .changes/unreleased/Features-20240628-074617.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Features
body: Use default_grain to resolve metric_time.
body: Use default_granularity to resolve metric_time.
time: 2024-06-28T07:46:17.768805-07:00
custom:
Author: courtneyholcomb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,16 @@ def resolve_matching_item_for_querying(
issue_set=push_down_result.issue_set,
)

# TODO: this isn't working, figure out why
filter_to_use = (
DefaultTimeGranularityPattern(
metric_lookup=self._manifest_lookup.metric_lookup, queried_metrics=queried_metrics
)
if queried_metrics
else
)
push_down_result = push_down_result.filter_candidates_by_pattern(
BaseTimeGrainPattern(),
filter_to_use,
)
logger.info(
f"Spec pattern:\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ metric:
type: simple
type_params:
measure: listings
default_granularity: day
---
metric:
name: "lux_listings"
Expand All @@ -100,20 +101,23 @@ metric:
type_params:
measure: listings
filter: "{{ Dimension('listing__is_lux_latest') }}"
default_granularity: day
---
metric:
name: "smallest_listing"
description: "smallest listing"
type: simple
type_params:
measure: smallest_listing
default_granularity: day
---
metric:
name: "largest_listing"
description: "largest listing"
type: simple
type_params:
measure: largest_listing
default_granularity: day
---
metric:
name: "identity_verifications"
Expand Down Expand Up @@ -769,6 +773,7 @@ metric:
type_params:
measure: listings
filter: "{{ Metric('bookings', ['listing']) }} > 2"
default_granularity: day
---
metric:
name: popular_listing_bookings_per_booker
Expand All @@ -780,3 +785,4 @@ metric:
denominator:
name: listings
filter: "{{ Metric('views', ['listing']) }} > 10"
default_granularity: day
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ semantic_model:
type: time
expr: created_at
type_params:
time_granularity: day
time_granularity: second
- name: created_at
type: time
type_params:
Expand Down

0 comments on commit 0c1d3ab

Please sign in to comment.