Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test if any filters exist and if they do make sure there are properties to filter on for decide endpoint #1759

Merged
merged 2 commits into from
Sep 29, 2020

Conversation

fuziontech
Copy link
Member

@fuziontech fuziontech commented Sep 29, 2020

Changes

you can see with this example that the property filters are empty but it is still evaluating is_simple_flag to be False

{'id': 71,
   'name': '[Clickhouse] retention endpoint',
   'key': 'ch-retention-endpoint',
   'rollout_percentage': 100,
   'filters': {'properties': []},
   'deleted': False,
   'active': True,
   'created_by': {'id': 218,
    'distinct_id': 'C8UGS3uhn4QTfUiZr1RyqTmtJ31AokcbotSpX2rafCQ',
    'first_name': 'Eric',
    'email': 'eric@posthog.com'},
   'created_at': '2020-09-28T12:24:55.162765Z',
   'is_simple_flag': False}

Checklist

  • All querysets/queries filter by Team (if this PR affects any querysets/queries)
  • Backend tests (if this PR affects the backend)
  • Cypress E2E tests (if this PR affects the front and/or backend)

@timgl timgl temporarily deployed to posthog-flat-jc2f9z3xquk80w9ny September 29, 2020 15:22 Inactive
filters = feature_flag.filters
if not filters:
return True
if not feature_flag.filters.get("properties", []):
Copy link
Member

Choose a reason for hiding this comment

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

NIT: filters directly instead of feature_flag.filters

@fuziontech fuziontech temporarily deployed to posthog-flat-jc2f9z3xquk80w9ny September 29, 2020 15:32 Inactive
@EDsCODE EDsCODE merged commit 389571d into master Sep 29, 2020
@EDsCODE EDsCODE deleted the flat branch September 29, 2020 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants