Skip to content

Commit

Permalink
add note about not handling groups
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarticus committed Oct 28, 2024
1 parent 797adbe commit 71def67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rust/feature-flags/src/cohort_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ impl Cohort {
}

/// Parses the filters JSON into a CohortProperty structure
// TODO: this doesn't handle the deprecated "groups" field, see
// https://github.com/PostHog/posthog/blob/feat/dynamic-cohorts-rust/posthog/models/cohort/cohort.py#L114-L169
// I'll handle that in a separate PR.
pub fn parse_filters(&self) -> Result<Vec<PropertyFilter>, FlagError> {
let wrapper: serde_json::Value = serde_json::from_value(self.filters.clone())?;
let cohort_property: InnerCohortProperty =
Expand Down

2 comments on commit 71def67

@neilkakkar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be easier to do a python migration to remove groups / update with filters. We already do this iirc for old cohorts that are saved again, so there might not be too many here, and plus will clean up the code everywhere.

@dmarticus
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a great call. Would love to clean up that kludge.

Please sign in to comment.