* Use ruff formatter
Ruff is now also a formatter! And it runs in a fraction of a second
across our whole codebase vs "I waited more than 30s and cancelled it
because I got bored".
* Config and command -> ruff
* Run 'ruff format .'
* Update query snapshots
* Run 'ruff format .'
* Fix format after commit hook
* Update query snapshots
* Fix type error - ignore comment moved
* Exclude hogql grammar from formatting and reverted grammar
* Run format
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tom Owers <tom@paace.co>
Today it annoyed me I could verify an event but not a property
Changes
Adds property definition verification, which was mostly copy-pasta from existing code
* feat(person-override): Add a helper model to indirectly reference person overrides
This allows us to use an exclusion constraint on the person overrides table instead of directly using a FK on posthog_person.
* test(person-overrides): Update tests to match new constraint
* fix(migration): Add drop extension query to reverse migration
* fix(migration): Use correct table name
* refactor(person-overrides): Make team a regular bigint field without FK
* refactor(person-overrides): Rename Helper model to Mapping
* feat(person-override): Add a helper model to indirectly reference person overrides
This allows us to use an exclusion constraint on the person overrides table instead of directly using a FK on posthog_person.
* wip: add test for concurrent updates to posthog_personoverride table
* refactor
* Update snapshots
* fix(isort): Correctly sort imports
* fix(ee-cohort-test): Delete person after creating it
* fix: person constraint in person overrides table (#14319)
* nits
* fix migration tests
* chore(migration): Bump migration number to 0302
* Update snapshots
* feat: person-overrides writes
* test(person-overrides): Add concurrent tests to person-overrides model
* feat(person-merge): Update merge to use new helper table
* fix(tests): Pass poEEmbraceJoin to updatePersonState in test
* fix(person-state): Format person-overrides message for ClickHouse
* test(api): Add function to reload dictionary for person overrides
* fix: poe final test failure
* refactor(person-state): Make failed attempts a class variable to
This allows us to mock it during testing as some tests require
immediate failures.
* fix(postgres-utils): Apply some magic changes lost to time
* fix(person-state): Join with helper table to return UUIDs
* fix(person-state): Use single quotes for UUID queries
* test(person-overrides): Skip test that doesn't work without a merge command
* test(person-state): Add a very complicated query to get UUIDs in a test
* test(person-state): Try waiting longer, this is flaky
* fix(migrations): Remove unused migration
* fix(person): Undo unneeded person model changes
* chore: Clean-up artifacts from rebase on model branch
* refactor(person-state): Rename mergeAttempts and don't read from ENV
* chore: Better clarify oldest_event usage in comment
Co-authored-by: Tiina Turban <tiina303@gmail.com>
* refactor(person-state): Update version in queries
* fix(person-state): Use new mapping model instead of helper
* fix(migrations): Re-add constraint deleted on field drop
* revert: Re-enable test that was skipped
Test was originally skipped due to missing a $merge command, but now
$merge_dangerously is available, so the test should pass.
* test: Attempt to refresh dictionary in test
* Update query snapshots
* Update query snapshots
* test: Expect dictionaries to be refreshed before resuming test
* fix(test): Use alias property for $merge_dangerously in test
* fix(test): Expect any string like in all other tests
* test: Fix order of events to determine merged persons
* chore: Update comment regarding overrides mapping query
* chore: Remove out of date comment
* test: Set number of retries to 0 when updating persons
* test: Delete comment
* test: Assert clickhouse state after identify
* chore: Move comment
* chore: Delete TODO regarding oldest_event updates
* test: Assert events are still processed if merge fails
* test: Assert properties are processed if merge fails
* test: Don't expect to throw when failing merges
* fix: Indent RETURNING query clause
Co-authored-by: Harry Waye <harry@posthog.com>
* chore: Remove out of date comment
Co-authored-by: Tiina Turban <tiina303@gmail.com>
* test: Resume merges after test suite
* test: Run processPersonStep tests for both poEEmbraceJoin modes
---------
Co-authored-by: Harry Waye <harry@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tiina Turban <tiina303@gmail.com>
* allow edit of property type in UI for all users
* allow free users to update property type
* Update query snapshots
* Update UI snapshots for `chromium` (1)
* extra test
* Update query snapshots
* Update UI snapshots for `chromium` (1)
* add an isProperty and use that
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* feat(perf): Add minmax indexes for materialized columns
* Add more cleanup code
* Make migration not required on boot
* Update snapshots
* alter_sync
* Try some other approach for tests
* Try not creating minmax indexes in tests
* Remove aged test
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* fix(queries): explicitly prepend table person_id comes from in cohort queries with pdi joins
* Update snapshots
* another test
* Update snapshots
* Update snapshots
* Update snapshots
* another try
* fixes
* Update snapshots
* trigger new test run
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* feat(person-on-events): track groups-on-events separately using instance setting
We want to release persons-on-events but we found groups-related issues
in incoming data that need to be fixed to release the feature for
groups.
Instead of delaying the release further, this change allows us to turn
persons-on-events on only for persons and handle groups separately
* Update CI
* fix ee/clickhouse/models/test/test_property.py tests
* add GROUPS_JOIN_QUERY if needed for breakdowns
* Excluse a breakdown test
* Skip some funnels breakdown tests with mat group columns
* Skip groups-related breakdown tests
* Skip a group property test
* Undo changes to breakdown_props.py
* Update test_property.py
* Update snapshots
* groups_on_events off by default
* Update snapshots
* Remove override_instance_config
* Add a docstring
* Make setting editable
* Fix breakdowns issue
* Update snapshots
* Update snapshots
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* api
* add performed_rollback
* add celery task and tests
* rollback test
* remove first and last
* add sentry stuff
* basic auto rollback UI
* fix errors
* testable
* add errors rollback ui
* clean up sentry keys
* clean up some ui stuff
* add some sentry context
* update ui
* fix celery
* Update posthog/api/feature_flag.py
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
* add sentry instructions when not enabled
* add sentry context
* merge migration
* remove unnecessary field right now and update UI to 7 day trailing average
* fix migration
* fix frontend type
* activity
* reset migratioN'
* remove default
* update test
* add feature flag
* add view for conditions and make sure insight loads
* Update snapshots
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: Li Yi Yu <li@posthog.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>