0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
Commit Graph

67 Commits

Author SHA1 Message Date
Tomás Farías Santana
61870fa8ca
chore: Update stub package (#21679)
Co-authored-by: Julian Bez <julian@posthog.com>
2024-05-07 16:09:18 +00:00
Julian Bez
0d2e574865
chore(deps): Upgrade ruff and mypy (#22035) 2024-05-03 08:00:43 +01:00
Eric Duong
20a9b50b45
Revert "chore(data-warehouse): convert postgres import to async" (#21995)
Revert "chore(data-warehouse): convert postgres import to async (#21959)"

This reverts commit ec79157d94.
2024-04-30 15:58:01 -04:00
Eric Duong
ec79157d94
chore(data-warehouse): convert postgres import to async (#21959)
* convert postgres import to async

* use async

* remove sqlalchemy

* update package vers

* change var name

* adjust date vars
2024-04-30 15:23:06 -04:00
Eric Duong
9fa792dfe1
chore(data-warehouse): upgrade dlt version (#21743)
* update requirements

* change version

* Fixed mypy issues

* remove pip-tools

---------

Co-authored-by: Tom Owers <owerstom@gmail.com>
2024-04-23 10:37:08 -04:00
Michael Matloka
233d3a9098
chore(deps): Remove unused Python requirements (#21580)
* chore(deps): Remove unused Python requirements

* Also remove `dnspython`

* Recompile txts

* Revert "Also remove `dnspython`"

This reverts commit 7eaf89979b774808cc0920c34a3a1cf1d75d2f14.

* Re-recompile txts

* Remove more deps based on `deptry`

* Restore `phonenumberslite`

* Restore `geoip2`

* Restore `python3-saml`

* Move `prance` and `openapi-spec-validator` to dev reqs

* Reorder `geoip2`

* Force HTTP 1.1 in downloading MMDB

Should fix CI failures caused by `curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)` (e.g. https://github.com/PostHog/posthog/actions/runs/8741861825/job/23988870688?pr=21580).
2024-04-22 22:52:47 +02:00
Julian Bez
a0fc086175
chore(deps): Upgrade ruff (#21648) 2024-04-19 14:19:10 +02:00
Julian Bez
dc0cf33e8e
chore(deps): Upgrade to Django 4.2 (#18653)
* Upgrade dependencies

* Fix middleware error

Among
https://docs.djangoproject.com/en/4.2/releases/4.0/#features-removed-in-4-0

* Upgrade psycopg

We need to be on >= 3.1.8

Locally there is an additional problem that somehow psycopg2
seemingly overshadows psycopg, making it appear that 3.1 works.

Had to install pip install "psycopg[binary,pool]==3.1.2" to
recreate the problem.

* Go to Django 4.1 because of problems with psycopg3

We use custom SQL that somehow doesn't get formatted in the right way
using server or client side cursors.

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Switch TaggedItem tests to assert ValidationError

Because full_clean validates since Django 4.1, see
https://docs.djangoproject.com/en/4.2/releases/4.1/#validation-of-constraints

* Remove type: ignore comments

Come up as
error: Unused "type: ignore" comment

* Update query snapshots

* Figure out psycopg problem and try Django 4.2 again

* Update query snapshots

* Fix other IN errors

* Fix getting status

* Fix psycopg3 issues

* Fix psycopg issues

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update deps

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Fix more tests

* Adjust baseline

* Remove sqlcommenter (should be PostgresQL only anyways)

* Fix file

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Fix queries

* Fix query

* Revert

* Update requirements.in

* Remove restore-virtualenv

Because not maintained anymore

* Revert "Remove restore-virtualenv"

This reverts commit c2a7ef8a1e.

* mypy

* Adjust num queries

* Adjust num queries

* Adjust num queries

* Update query snapshots

* Add to updated_fields

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
2024-04-16 10:53:32 +01:00
Brett Hoerner
36d1be08f9
feat(batch-exports): Add HTTP Batch Export destination (#20318)
* feat(batch-exports): Add HTTP Batch Export destination

To possibly be reused in the future, but for now it only submits
payloads in the PostHog /batch format.

* add geoip_disable, don't toJSONString elements_chain, and mark some HTTP status codes as non-retryable

* Add heartbeating to HTTP batch export

* Update query snapshots

* Update query snapshots

* fix: Re-use client session

* refactor: Rename last_uploaded_part_timestamp to last_uploaded_timestamp

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tomás Farías Santana <tomas@tomasfarias.dev>
2024-02-19 10:40:09 +00:00
David Newell
974553f84d
chore: upgrade OpenAI client (#19986) 2024-01-29 11:47:14 +00:00
Julian Bez
7cabe21ae3
chore: Upgrade pydantic, mypy, and others (#19660)
* Upgrade pydantic and all related
* Upgrade mypy
* Add mypy-baseline

To update baseline when you fix something (only then!) use:

    [mypy cmd] | mypy-baseline sync
2024-01-10 08:32:55 +00:00
danielxnj
d9faf41195
Revert "chore(deps): Upgrade to Django 4.1 (#19285)" (#19337)
This reverts commit 3c399da5d2.
2023-12-14 12:57:30 -05:00
Julian Bez
3c399da5d2
chore(deps): Upgrade to Django 4.1 (#19285)
Another try for #18830
2023-12-14 15:51:38 +00:00
Julian Bez
8e8a6dcead
fix: Revert "chore(deps): Upgrade to Django 4.1" (#19258)
Revert "chore(deps): Upgrade to Django 4.1 (#18830)"

This reverts commit 580c7b1aba.
2023-12-11 09:51:20 -08:00
Julian Bez
580c7b1aba
chore(deps): Upgrade to Django 4.1 (#18830)
* Upgrade dependencies
* Fix middleware error

Among
https://docs.djangoproject.com/en/4.2/releases/4.0/#features-removed-in-4-0

* Switch TaggedItem tests to assert ValidationError

Because full_clean validates since Django 4.1, see
https://docs.djangoproject.com/en/4.2/releases/4.1/#validation-of-constraints

* Remove type: ignore comments

* Set CSRF_TRUSTED_ORIGINS

* Update access.py

Co-authored-by: Paul D'Ambra <paul@posthog.com>
2023-12-11 13:44:40 +00:00
Eric Duong
1fcd437f1d
feat(data-warehouse): migrations for data sync (#18966)
* just code for migrations

* use all timezones because update would cause common_timezones to be less inclusive

* install new dependencies

* add comment

* revert

* restore

* fix type
2023-11-29 13:30:50 -05:00
Tom Owers
5513be7731
chore: upgraded Ruff linter (#18188)
* Upgraded Ruff linter

* Formatted whole codebase with new ruff rules

* Revert import removal

* Fixed mypi issues or added ignores

* Fixed schema formatting

* Fixed hogvm failing tests

* Remove duplicate key in list
2023-10-26 12:38:15 +02:00
James Greenhill
3e13484de1
chore: move billing celery job to use offline cluster and increase timeout from 2 minutes to 5 min (#17656)
* chore: move billing celery job to use offline cluster and increase timeout from 2 minutes to 5 min

* add retry logic

* add types for retry
2023-09-27 21:32:52 +00:00
Thomas Obermüller
26f29f11e4
chore(python): upgrade pydantic and datamodel-code-generator (#17477) 2023-09-18 15:05:46 +02:00
Paul D'Ambra
48515ccf8b
chore: update pytest (#16947) 2023-08-10 12:10:16 +01:00
Harry Waye
440642243a
chore(batch-exports): add snowflake export workflow (#15907)
* chore(batch-exports): add snowflake export workflow

This workflow uses Snowflake internal stages to load data from
ClickHouse into a Snowflake table. We maintain the existing events table
schema as used in the existing Snowflake App.

Something I haven't done yet is:

 1. made sure e.g. we get the `elements` and `person_set` etc. data into
    Snowflake.
 2. the additional frontend to enable configuring the Snowflake
    connection.

* remove unsed var

* include excluded events in test
2023-06-09 06:59:07 +00:00
Neil Kakkar
db4d0a205d
feat(decide): Add proper analytics for decide requests (#15837) 2023-06-06 17:14:13 +01:00
Harry Waye
ac1d3e7b52
feat(batch_exports): add backend API and S3 temporal workflow (#15649)
* feat(batch_exports): add backend API and S3 temporal workflow

This adds the backend API for batch exports, which will handle reverse
ETL exports to e.g. S3, Snowflake etc.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-01 17:05:37 +01:00
Paul D'Ambra
b7c21429bc
fix: protect schema and port in exporter urls (#15537) 2023-05-16 11:13:45 +02:00
Paul D'Ambra
5efd14441e
chore: upgrade drf (#15433) 2023-05-10 09:37:53 +01:00
Tomás Farías Santana
c641f0270b
fix: Update packaging dependency and pin prance (#15228)
https://twitter.com/pauldambra/status/1650845189848571904
2023-04-25 13:27:59 +00:00
Paul D'Ambra
6440988c13
fix: updates some dependencies with "high" vulnerabiltiies (#15215)
* fix: update django to v3 latest

* upgrade redis-py too
2023-04-25 08:14:40 +01:00
James Greenhill
03eaed4390
chore: remove isort - ruff is doing the job now (#14849) 2023-03-21 11:53:45 -06:00
James Greenhill
9a2a087a9c
feat: Migrate flake8 -> ruff (#14838)
* feat: Migrate flake8 -> ruff

* move the exclude to configs instead of CI
2023-03-20 23:00:54 -06:00
James Greenhill
0223d7ab86
feat: Add Temporal to the dev and hobby stacks (#14658)
* feat: Add Temporal to the dev and hobby stacks

* disable elastic for hobby because of resources

* checkpoint

* update requirements

* worker is up, but without the sandbox

* ensure temporal does not depend on elastic

* Feedbacked

* pip-compile dev

* mypy fixes

* add a bit of colorful logging

* add django temporal worker to the mix

* checkpoint for dev-full docker

* Working on docker-full, but checkpointing for now

* add migration bits for full
2023-03-20 16:56:14 -06:00
Harry Waye
a29e137069
chore(recordings): add command to generate session recording events (#14496)
* chore(recordings): add command to generate session recording events

The intention of this is to be able to generate somewhat realistic
session recording events to test the ingestion pipeline performance,
such that we don't need to rely on pushing to production.

This command just outputs for stdout a single JSON encoded line per
event, which can then e.g. be piped into kafkacat or
kafka-console-producer, or put to a file to then be used by vegeta to
perform load testing on the capture endpoint.
2023-03-08 11:46:56 +00:00
Frank Hamand
0dfc549f96
chore: Python 3.10 (#14360)
* Python 3.10

Performance gains go brrr

* Add missing SAML deps

* Add missing dep to dockerfile

* Update mypy to 0.981 for 3.10.7 compatibility

Needed this bug to be fixed: https://github.com/python/mypy/issues/13627

This also incidentally fixed the mypy bug in csv_exporter.py

* bump to 3.10.10
2023-02-24 09:14:09 +00:00
Frank Hamand
1d7afd3352
chore: Python 3.9 (#14336)
* Update to python 3.9

* Update pytest

6.2.2 doesn't support python 3.9+

* Add missing saml dependencies

* Update snapshots

* Update snapshots

* Update snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-22 09:23:22 +00:00
Marius Andra
67453e5a88
feat(data-exploration): data exploration backend API with types (#13933)
* feat(data-exploration): backend json schema validation

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* refactor

* switch to pydantic

* split into v2 events list query

* add backend query endpoint

* Update snapshots

* make events query work

* bring back HogQLExpression, inline all __root__ only classes in python, remove timestamp in old events query

* Update snapshots

* Update snapshots

* schema and mypy

* Update snapshots

* Update snapshots

* restore /fake/ orderBy (only "timestamp" and "-timestamp" are supported)

* Update snapshots

* Update snapshots

* Update snapshots

* raise if invalid json

* Update snapshots

* remove __root__ hack

* improve comments, in and out of quotes

* shrug

* future proofing

* comment

* rename to "run_events_query"

* simplify

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-27 15:30:28 +01:00
Karl-Aksel Puulmann
b33347205c
fix: Revert "chore(tests): add pytest-randomly plugin to randomize test run order" (#12335)
* Revert "chore(tests): add pytest-randomly plugin to randomize test run order (#12307)"

This reverts commit 313de83cb8.

* Update snapshots

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-19 13:30:16 +03:00
zackelan
313de83cb8
chore(tests): add pytest-randomly plugin to randomize test run order (#12307)
* chore(tests): add pytest-randomly plugin to randomize test run order

* Update snapshots

* Update snapshots

* Update snapshots

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-18 09:34:34 -07:00
Guido Iaquinti
8145b682bf
chore(numpy): upgrade from 1.21.4 to 1.23.3 (#12142) 2022-10-07 14:14:39 +02:00
Paul D'Ambra
046184d4f3
chore: nice diff for pytest (#11963) 2022-09-26 14:12:45 +01:00
Paul D'Ambra
802a3e183c
chore: update python redis (#11741)
* largest change

* fewer dependency changes

* update to use not deprecated zrange

* obey mypy
2022-09-08 18:31:06 +01:00
Guido Iaquinti
49f330ee67
chore(deps): update flake8 dependencies (#11711) 2022-09-07 17:24:00 +02:00
Michael Matloka
5d2ad6c7bb
chore(deps): Update black to 22.8.0 (#11596)
* chore(deps): Update `black` to `22.8.0`

* Format
2022-09-05 14:38:54 +02:00
Tiina Turban
49f3311a65
chore: nuke protobuf fully (#10932) 2022-08-03 15:41:44 +02:00
Guido Iaquinti
35729df018
fix(pip-tools): upgrade from 6.6.1 to 6.6.2 (#10174) 2022-06-07 15:12:01 +02:00
Ben White
57874f9db2
feat(exports): Dashboard / Insight exporting (#9830)
* Adds chromium / selenium for image exporting
* Added uploading of downloads folder to artefacts
* Adds ExportButton to generate desired asset
2022-05-27 14:31:17 +02:00
Paul D'Ambra
55f23ee80d
chore: upgrade pip tools (#9859)
* update pip tools

* no need to do two step pip install
2022-05-19 15:01:32 +01:00
Neil Kakkar
5d94e93784
test: retry flakey experiment tests on failure (#9015)
* test: retry flakey experiment tests on failure

* bump max runs
2022-03-15 11:08:35 +00:00
Karl-Aksel Puulmann
9769ef0b5d
Improve backend CI (update .test_timings, run against different CH version) (#8708)
* Make clickhouse server image version configurable

* Attempt to use a reusable workflow for backend tests

* Try a composite action

* Add missing shell: bash

* Temporarily remove a step

* Cache id parameter

* Include the action when needing to rerun

* Move checking migrations to separate file

This didn't work in composite actions tests and slows down every
parallelized test execution for no reason. This should have been
separate in the first place.

* Rename job

* Improve check-migrations

* Start stack in the new job

* Remove shell

* Solve flaky test

* Remove unused file

* Create a test timings job

* Use checkout@v2 - https://github.com/cds-snc/github-actions/issues/23

* Ignore coverage files

* Save backend test durations

* Install pytest-split

* Clean up ci-backend

* Move actions code around

* wording improvement

* Save backend test durations

* Add a comment

* Make it possible to run tests with a different clickhouse version

* Remove debugging code

* Fix typo

* Boolean inputs please work

Fixes overeager test running as per https://github.com/actions/runner/issues/1483

Co-authored-by: PostHog Bot <hey@posthog.com>
2022-02-22 17:06:04 +02:00
Guido Iaquinti
ddc260e1f1
Remove flake8-commas (#8695) 2022-02-18 17:20:55 +01:00
Guido Iaquinti
7d22eebf03
Pin versions in requirements-dev.in (#8665) 2022-02-17 10:19:55 +00:00
Guido Iaquinti
40fe3a6f54
Rebuild requirements files (#8648) 2022-02-17 10:54:48 +01:00