Closed danielbachhuber closed 1 day ago
Updates property_to_expr() to handle data warehouse properties with nested values, e.g.:
property_to_expr()
prepared_count_query.properties = [ DataWarehousePropertyFilter( key=f"{column_name}.event", value="$feature_flag_called", operator=PropertyOperator.EXACT, type="data_warehouse", ), DataWarehousePropertyFilter( key=f"{column_name}.properties.{self.breakdown_key}", value=self.variants, operator=PropertyOperator.EXACT, type="data_warehouse", ), ]
Without the patch, the properties evaluate to:
sql(and(equals(events.event, '$feature_flag_called'), or(equals(`$feature/dw-trends-nov-14-v2`, 'control'), equals(`$feature/dw-trends-nov-14-v2`, 'test'))))
With the patch, the properties evaluate to:
sql(and(equals(events.event, '$feature_flag_called'), or(equals(events.properties.`$feature/dw-trends-nov-14-v2`, 'control'), equals(events.properties.`$feature/dw-trends-nov-14-v2`, 'test'))))
From https://github.com/PostHog/posthog/pull/26301
Tests should pass
Also verified that https://github.com/PostHog/posthog/pull/26301 works as expected with this patch
Changes
Updates
property_to_expr()
to handle data warehouse properties with nested values, e.g.:Without the patch, the properties evaluate to:
With the patch, the properties evaluate to:
From https://github.com/PostHog/posthog/pull/26301
How did you test this code?
Tests should pass
Also verified that https://github.com/PostHog/posthog/pull/26301 works as expected with this patch