* connect funnel persons to the frontend
* fixes
* simplify feature flag call and open persons modal on bar click
* persons dropoff call
* move methods to kea and clean up code
* remove unused imports
* round the percentage down
* pass in correct step number
* type fix
* small fixes
* prettier
* clickhouse enabled check
* fix clickhouse enabled check
Co-authored-by: Li Y Yu <liyi@Lis-MacBook-Pro.local>
* connect funnel persons to the frontend
* fixes
* simplify feature flag call and open persons modal on bar click
* persons dropoff call
* move methods to kea and clean up code
* remove unused imports
* round the percentage down
* pass in correct step number
* type fix
* small fixes
* prettier
* clickhouse enabled check
Co-authored-by: Li Y Yu <liyi@Lis-MacBook-Pro.local>
* move breakdown logic to separate class
* working breakdown without limits
* add limit logic
* remove print
* arr to dict
* tests
* fix test
* fix tests
* make suggested change
* remove one of the changes
* addjust again
* make funcs pure
* add limit
* Display empty values correctly
* fix broken test and I
* handle more cases of empty strings / objects
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Fix funnel trends backwards compatibility
* Don't set funnel_viz_type outside of funnel insight filters
* Reorder conditions for clarity and use null check
* Use redis for axes handler
Original motivation: axes is running into `InterfaceError: connection already closed`
for database (pg) connections. Not sure what that is caused by, but it's
causing api requests to sporatically fail hence reducing reliability.
Sentry issue: https://sentry.io/organizations/posthog/issues/1905826905/?project=1899813&statsPeriod=14d
This error seems to be only occurring in axes hence making me think
switching out the handler will work wonders.
Switching the handler to redis has other benefits as well. As axes is
hit every request this should speed things up. To quote documentation:
> axes.handlers.cache.AxesCacheHandler only uses the cache for monitoring attempts and does not persist data other than in the cache backend; this data can be purged automatically depending on your cache configuration, so the cache handler is by design less secure than the database backend but offers higher throughput and can perform better with less bottlenecks.
* Disable axes during testing
* fix when new steps in the url get merged with old steps from values (new steps contain actions, old events)
* set default event in funnels
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* setup funnel option type, and proper API for persons and usual funnel routes
* update tests, fix bugs
* make insights compulsory
* nvm
* remove insights key
* fix person caching
* revert problems, fix typings
* address comments
* dont use defaults in mixins
* typing
* cleanup and fix TODOs
* update test
* adapt api to 4957
Co-authored-by: eric <eeoneric@gmail.com>
* Create funnel_time_to_convert.py
* Create test_funnel_time_to_convert.py
* Remove unused things
* Rework time to convert query to use our own SQL
* Add comments to query
* Fix typo in comment
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
* Use feedback
* Only override `ClickhouseFunnelTimeToConvert._format_results`
* Switch test users B and C around
* Fix typo
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: eric <eeoneric@gmail.com>
* Raise 400 instead of 500 if filter cohort does not exist
* Actually return empty 200 results instead of 400
Co-authored-by: eric <eeoneric@gmail.com>
* wip: pagination for persons on clickhouse funnels
* wip: added offset support for getting a list of persons; added support for conversion window;
* fixed mypy exception
* helper function to insert data for local testing
* moved generate code into separate class for more functionality later
* corrected person_distinct_id to use the person id from postgres
* minor corrections to generate local class along with addition of data cleanup via destroy() method
* reduce the number of persons who make it to each step
* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;
* funnel persons and tests
* initial implementation
* invoke the funnel or funnel trends class respectively
* add a test
* add breakdown handling and first test
* add test stubs
* remove repeats
* mypy corrections and PR feedback
* run funnel test suite on new query implementation
* remove imports
* corrected tests
* minor test updates
* correct func name
* fix types
* func name change
* move builder functions to funnel base
* add test classe for new funnel
* Handle multiple same events in the funnel (#4863)
* dedup + tests
* deep equality. Tests to come
* write test for entity equality
* finish testing funnels
* clean up comments
* add strict option for funnels
* typing
* use new persons pattern
* persons for funnel strict ordering
Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
* wip: pagination for persons on clickhouse funnels
* wip: added offset support for getting a list of persons; added support for conversion window;
* fixed mypy exception
* helper function to insert data for local testing
* moved generate code into separate class for more functionality later
* corrected person_distinct_id to use the person id from postgres
* minor corrections to generate local class along with addition of data cleanup via destroy() method
* reduce the number of persons who make it to each step
* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;
* funnel persons and tests
* initial implementation
* invoke the funnel or funnel trends class respectively
* add a test
* add breakdown handling and first test
* add test stubs
* remove repeats
* mypy corrections and PR feedback
* run funnel test suite on new query implementation
* remove imports
* corrected tests
* minor test updates
* correct func name
* fix types
* unordered step and test
* func name change
* move builder functions to funnel base
* add test classe for new funnel
* resolve issues with unordered funnel
* oops
* remove breakdown, fix mypy error
* Handle multiple same events in the funnel (#4863)
* dedup + tests
* deep equality. Tests to come
* write test for entity equality
* finish testing funnels
* clean up comments
* from O(2^N) to O(N)
* add query intuition blurb
* rm todo
* wip persons
* wip persons 2
* address comments
* test things, fix bugs
* match result format to funnel.py
Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
* Proposal: Use `ValidationError` over `ValueError` in views
This generates a nicer exception for our users (400 response instead of
500) and we cut down on 500 errors for things that are not expected to
work.
* Capitalization
Co-authored-by: Michael Matloka <dev@twixes.com>
* make funnel persons api call return values consistent with others
* update for regular funnels
* update tests
* black
* fix tests
* test fix
* fix tests
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
* wip: pagination for persons on clickhouse funnels
* wip: added offset support for getting a list of persons; added support for conversion window;
* fixed mypy exception
* helper function to insert data for local testing
* moved generate code into separate class for more functionality later
* corrected person_distinct_id to use the person id from postgres
* minor corrections to generate local class along with addition of data cleanup via destroy() method
* reduce the number of persons who make it to each step
* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;
* funnel persons and tests
* initial implementation
* invoke the funnel or funnel trends class respectively
* add a test
* add breakdown handling and first test
* add test stubs
* remove repeats
* mypy corrections and PR feedback
* run funnel test suite on new query implementation
* remove imports
* corrected tests
* minor test updates
* correct func name
* fix types
* unordered step and test
* func name change
* move builder functions to funnel base
* add test classe for new funnel
* resolve issues with unordered funnel
* oops
* remove breakdown, fix mypy error
* Handle multiple same events in the funnel (#4863)
* dedup + tests
* deep equality. Tests to come
* write test for entity equality
* finish testing funnels
* clean up comments
* from O(2^N) to O(N)
* add query intuition blurb
* rm todo
* address comments
Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
* open person link in new tab
* set up filtering for person modal
* leave basic search with fuse
* allow for property filtering
* clean up UI
* linter
* replace fuse with backend querying because of pagination issues
* lint
* cohort test failure fix
* prettier
* fix bug
* do not open new persons tab
* return unique persons
* reuse filter request method for persons modal search
* fix test and linter failures
* isort
* feature flag it
* don't disappoint mypy
* try to separate persons modal logic
* cleanup component and logic code
* try to make types happy
* more type fixing
* fix count bug
* more fixes
* type with session string instead of string
* sanitize url param
* add or session back
Co-authored-by: Marius Andra <marius.andra@gmail.com>