Skip to content

Commit

Permalink
chore(capture): change 'is False' to 'not' (#20804)
Browse files Browse the repository at this point in the history
cleanup(capture): change 'is False' to 'not'
  • Loading branch information
bretthoerner authored Mar 18, 2024
1 parent c570bd5 commit 7435fe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions posthog/api/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def capture_internal(event, distinct_id, ip, site_url, now, sent_at, event_uuid=

if (
distinct_id.lower() not in LIKELY_ANONYMOUS_IDS
and is_randomly_partitioned(candidate_partition_key) is False
and not is_randomly_partitioned(candidate_partition_key)
or historical
):
kafka_partition_key = hashlib.sha256(candidate_partition_key.encode()).hexdigest()
Expand Down Expand Up @@ -613,7 +613,7 @@ def is_randomly_partitioned(candidate_partition_key: str) -> bool:
if settings.PARTITION_KEY_AUTOMATIC_OVERRIDE_ENABLED:
has_capacity = LIMITER.consume(candidate_partition_key)

if has_capacity is False:
if not has_capacity:
if not LOG_RATE_LIMITER.consume(candidate_partition_key):
# Return early if we have logged this key already.
return True
Expand Down

0 comments on commit 7435fe6

Please sign in to comment.