Skip to content

Commit

Permalink
Remove validation added in parent PR
Browse files Browse the repository at this point in the history
This PR changed how we use the semantic_model_join_path, so this validation is no longer relevant. Now, the semantic_model_join_path does not include the last entity link, since the last join is not joining to a semantic model.
  • Loading branch information
courtneyholcomb committed Apr 30, 2024
1 parent 78d97b7 commit 3f2dbc5
Showing 5 changed files with 817 additions and 690 deletions.
Original file line number Diff line number Diff line change
@@ -312,21 +312,10 @@ class MetricSubqueryJoinPath:
metric_subquery_join_path_element: MetricSubqueryJoinPathElement
semantic_model_join_path: Optional[SemanticModelJoinPath] = None

def __post_init__(self) -> None: # noqa: D105
if self.semantic_model_join_path:
assert (
self.metric_subquery_join_path_element.join_on_entity == self.semantic_model_join_path.last_entity_link
), (
"Last entity link for `semantic_model_join_path` must match `semantic_model_join_path.join_on_entity`."
"This is the entity used to join the metric subquery to the outer query.",
)

@property
def entity_links(self) -> Tuple[EntityReference, ...]: # noqa: D102
return (
self.semantic_model_join_path.entity_links
if self.semantic_model_join_path
else (self.metric_subquery_join_path_element.join_on_entity,)
return (self.semantic_model_join_path.entity_links if self.semantic_model_join_path else ()) + (
self.metric_subquery_join_path_element.join_on_entity,
)

@property
Original file line number Diff line number Diff line change
@@ -96,6 +96,69 @@
'listing__lux_booking_fraction_of_max_value',
'listing__lux_booking_value_rate_expr',
'listing__lux_listing',
'listing__lux_listing__active_listings',
'listing__lux_listing__approximate_continuous_booking_value_p99',
'listing__lux_listing__approximate_discrete_booking_value_p99',
'listing__lux_listing__average_booking_value',
'listing__lux_listing__average_instant_booking_value',
'listing__lux_listing__bookers',
'listing__lux_listing__booking_fees',
'listing__lux_listing__booking_fees_last_week_per_booker_this_week',
'listing__lux_listing__booking_fees_per_booker',
'listing__lux_listing__booking_fees_since_start_of_month',
'listing__lux_listing__booking_payments',
'listing__lux_listing__booking_value',
'listing__lux_listing__booking_value_for_non_null_listing_id',
'listing__lux_listing__booking_value_p99',
'listing__lux_listing__booking_value_per_view',
'listing__lux_listing__booking_value_sub_instant',
'listing__lux_listing__booking_value_sub_instant_add_10',
'listing__lux_listing__bookings',
'listing__lux_listing__bookings_5_day_lag',
'listing__lux_listing__bookings_at_start_of_month',
'listing__lux_listing__bookings_fill_nulls_with_0',
'listing__lux_listing__bookings_fill_nulls_with_0_without_time_spine',
'listing__lux_listing__bookings_growth_2_weeks',
'listing__lux_listing__bookings_growth_2_weeks_fill_nulls_with_0',
'listing__lux_listing__bookings_growth_2_weeks_fill_nulls_with_0_for_non_offset',
'listing__lux_listing__bookings_growth_since_start_of_month',
'listing__lux_listing__bookings_join_to_time_spine',
'listing__lux_listing__bookings_month_start_compared_to_1_month_prior',
'listing__lux_listing__bookings_offset_once',
'listing__lux_listing__bookings_offset_twice',
'listing__lux_listing__bookings_per_booker',
'listing__lux_listing__bookings_per_dollar',
'listing__lux_listing__bookings_per_listing',
'listing__lux_listing__bookings_per_lux_listing_derived',
'listing__lux_listing__bookings_per_view',
'listing__lux_listing__derived_bookings_0',
'listing__lux_listing__derived_bookings_1',
'listing__lux_listing__discrete_booking_value_p99',
'listing__lux_listing__double_counted_delayed_bookings',
'listing__lux_listing__every_2_days_bookers_2_days_ago',
'listing__lux_listing__every_two_days_bookers',
'listing__lux_listing__every_two_days_bookers_fill_nulls_with_0',
'listing__lux_listing__instant_booking_fraction_of_max_value',
'listing__lux_listing__instant_booking_value',
'listing__lux_listing__instant_booking_value_ratio',
'listing__lux_listing__instant_bookings',
'listing__lux_listing__instant_lux_booking_value_rate',
'listing__lux_listing__instant_plus_non_referred_bookings_pct',
'listing__lux_listing__largest_listing',
'listing__lux_listing__listings',
'listing__lux_listing__lux_booking_fraction_of_max_value',
'listing__lux_listing__lux_booking_value_rate_expr',
'listing__lux_listing__lux_listings',
'listing__lux_listing__max_booking_value',
'listing__lux_listing__median_booking_value',
'listing__lux_listing__min_booking_value',
'listing__lux_listing__nested_fill_nulls_without_time_spine',
'listing__lux_listing__non_referred_bookings_pct',
'listing__lux_listing__referred_bookings',
'listing__lux_listing__smallest_listing',
'listing__lux_listing__twice_bookings_fill_nulls_with_0_without_time_spine',
'listing__lux_listing__views',
'listing__lux_listing__views_times_booking_value',
'listing__lux_listings',
'listing__max_booking_value',
'listing__median_booking_value',
@@ -165,6 +228,81 @@
'user__bookings_per_lux_listing_derived',
'user__bookings_per_view',
'user__company',
'user__company__active_listings',
'user__company__approximate_continuous_booking_value_p99',
'user__company__approximate_discrete_booking_value_p99',
'user__company__average_booking_value',
'user__company__average_instant_booking_value',
'user__company__bookers',
'user__company__booking_fees',
'user__company__booking_fees_last_week_per_booker_this_week',
'user__company__booking_fees_per_booker',
'user__company__booking_fees_since_start_of_month',
'user__company__booking_payments',
'user__company__booking_value',
'user__company__booking_value_for_non_null_listing_id',
'user__company__booking_value_p99',
'user__company__booking_value_per_view',
'user__company__booking_value_sub_instant',
'user__company__booking_value_sub_instant_add_10',
'user__company__bookings',
'user__company__bookings_5_day_lag',
'user__company__bookings_at_start_of_month',
'user__company__bookings_fill_nulls_with_0',
'user__company__bookings_fill_nulls_with_0_without_time_spine',
'user__company__bookings_growth_2_weeks',
'user__company__bookings_growth_2_weeks_fill_nulls_with_0',
'user__company__bookings_growth_2_weeks_fill_nulls_with_0_for_non_offset',
'user__company__bookings_growth_since_start_of_month',
'user__company__bookings_join_to_time_spine',
'user__company__bookings_month_start_compared_to_1_month_prior',
'user__company__bookings_offset_once',
'user__company__bookings_offset_twice',
'user__company__bookings_per_booker',
'user__company__bookings_per_dollar',
'user__company__bookings_per_view',
'user__company__current_account_balance_by_user',
'user__company__derived_bookings_0',
'user__company__derived_bookings_1',
'user__company__discrete_booking_value_p99',
'user__company__double_counted_delayed_bookings',
'user__company__every_2_days_bookers_2_days_ago',
'user__company__every_two_days_bookers',
'user__company__every_two_days_bookers_fill_nulls_with_0',
'user__company__identity_verifications',
'user__company__instant_booking_fraction_of_max_value',
'user__company__instant_booking_value',
'user__company__instant_booking_value_ratio',
'user__company__instant_bookings',
'user__company__instant_lux_booking_value_rate',
'user__company__instant_plus_non_referred_bookings_pct',
'user__company__largest_listing',
'user__company__listings',
'user__company__lux_booking_fraction_of_max_value',
'user__company__lux_booking_value_rate_expr',
'user__company__lux_listings',
'user__company__max_booking_value',
'user__company__median_booking_value',
'user__company__min_booking_value',
'user__company__nested_fill_nulls_without_time_spine',
'user__company__non_referred_bookings_pct',
'user__company__referred_bookings',
'user__company__regional_starting_balance_ratios',
'user__company__revenue',
'user__company__revenue_all_time',
'user__company__revenue_mtd',
'user__company__smallest_listing',
'user__company__total_account_balance_first_day',
'user__company__trailing_2_months_revenue',
'user__company__trailing_2_months_revenue_sub_10',
'user__company__twice_bookings_fill_nulls_with_0_without_time_spine',
'user__company__views',
'user__company__views_times_booking_value',
'user__company__visit_buy_conversion_rate',
'user__company__visit_buy_conversion_rate_7days',
'user__company__visit_buy_conversion_rate_7days_fill_nulls_with_0',
'user__company__visit_buy_conversion_rate_by_session',
'user__company__visit_buy_conversions',
'user__company_name',
'user__created_at__day',
'user__created_at__extract_day',
Loading

0 comments on commit 3f2dbc5

Please sign in to comment.