Skip to content

Commit

Permalink
Fix other IN errors
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie committed Nov 16, 2023
1 parent a1731eb commit 15fe236
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions posthog/api/property_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def with_properties_to_filter(self, properties_to_filter: Optional[str]) -> "Que
if properties_to_filter:
return dataclasses.replace(
self,
name_filter="AND name IN %(names)s",
name_filter="AND name = ANY(%(names)s)",
params={**self.params, "names": tuple(properties_to_filter.split(","))},
)
else:
Expand Down Expand Up @@ -218,7 +218,7 @@ def with_event_property_filter(

if event_names and len(event_names) > 0:
event_property_field = f"{self.posthog_eventproperty_table_join_alias}.property is not null"
event_name_join_filter = "AND event in %(event_names)s"
event_name_join_filter = "AND event = ANY(%(event_names)s)"

return dataclasses.replace(
self,
Expand Down Expand Up @@ -249,7 +249,9 @@ def with_excluded_properties(self, excluded_properties: Optional[str], type: str
)
return dataclasses.replace(
self,
excluded_properties_filter=f"AND {self.property_definition_table}.name NOT IN %(excluded_properties)s"
excluded_properties_filter=(
f"AND NOT ({self.property_definition_table}.name = ANY(%(excluded_properties)s))"
)
if len(excluded_list) > 0
else "",
params={
Expand Down

0 comments on commit 15fe236

Please sign in to comment.