* Improve time to convert binning behavior, add autobinning
* Test and fix custom bin count
* Expose `ClickhouseFunnelTimeToConvert` in the API
* Revert a column name change
* Fix `bin_count` clamping
* Add an API test for viz type `time_to_convert`
* Update SQL comments
* Remove some unused imports
* Fix `FunnelTypeMixin.funnel_viz_type`
* Remove `DEBUG=1`
* Load action event count asynchronously
This speeds up loading/editing events quite a bit on clickhouse.
Issue: https://github.com/PostHog/posthog/issues/4802
* Add test for /api/action/{id}/count endpoint
* Update code
Currently, some metrics queries fail for our clients on clickhouse
deployments since replication is not used there. The errors are ignored
on application-side but they make clickhouse logs impossible to read.
This PR fixes this issue
* Solve ospath issue
* try separate cypress cache
* Separate install
* ls
* try
* Try to put everything in same cache
* Remove cypress plugin snapshot
* fix cohorts and funnels
* 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>