Commit Graph

84 Commits

Author SHA1 Message Date
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 c2a7ef8a1e293cc6bfd9e213f564a812a7831063.

* 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
dependabot[bot]
a279ec0837 chore(deps): bump the pip group across 1 directory with 2 updates (#20902) 2024-04-10 08:09:55 +00:00
David Newell
8fb3b9bf2f chore: update python requirements (#20873) 2024-03-13 15:19:36 +00:00
Michael Matloka
db54941410 fix(dev): Fix CH replicated table error when starting E2E tests (#20672) 2024-03-04 12:06:53 +00:00
dependabot[bot]
5d60a10848 chore(deps): bump the pip group across 1 directories with 3 updates (#20413)
bump the pip group across 1 directories with 3 updates

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  dependency-group: pip-security-group
- dependency-name: jinja2
  dependency-type: indirect
  dependency-group: pip-security-group
- dependency-name: lxml
  dependency-type: indirect
  dependency-group: pip-security-group
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 14:22:37 +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
Julian Bez
11e4d8487e chore(deps): Upgrade Django 4.1 (#20006)
* Upgrade to Django 4.1

* Adjust requirements

* Adjust mypy baseline

* Sync with later version

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-07 09:19:06 +00:00
David Newell
974553f84d chore: upgrade OpenAI client (#19986) 2024-01-29 11:47:14 +00:00
dependabot[bot]
e9b825236f chore(deps): bump urllib3 from 1.26.13 to 1.26.18 (#19643)
* chore(deps): bump urllib3 from 1.26.13 to 1.26.18

Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.13 to 1.26.18.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.13...1.26.18)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* upgrade dependency using pip-compile

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paul D'Ambra <paul@posthog.com>
2024-01-15 14:17:13 +01: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
dependabot[bot]
e74c207b31 chore(deps): bump django from 3.2.19 to 3.2.23 (#19574)
Bumps [django](https://github.com/django/django) from 3.2.19 to 3.2.23.
- [Commits](https://github.com/django/django/compare/3.2.19...3.2.23)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-08 08:38:57 +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
Paul D'Ambra
2db045910f chore: celery 5.x (#17480) 2023-09-28 14:01:02 +01: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
Paul D'Ambra
0e0e572b7a chore: upgrade to Django 3.2.19 (#16193) 2023-06-22 13:45:40 +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
cffeea724f revert: "chore: upgrade celery" (#15549) 2023-05-15 17:08:19 +00:00
Paul D'Ambra
4a7e3c293e chore: upgrade celery (#15540) 2023-05-15 09:25:30 +01: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
dependabot[bot]
c24c2dfb07 chore(deps): bump sqlparse from 0.4.2 to 0.4.4 (#15192)
* chore(deps): bump sqlparse from 0.4.2 to 0.4.4

Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.2 to 0.4.4.
- [Release notes](https://github.com/andialbrecht/sqlparse/releases)
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.4.2...0.4.4)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update CI to work on forks

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-24 13:32:51 +02:00
Harry Waye
72c53ce55c chore(capture): add OpenAPI spec for capture endpoints (#14962)
* Revert "Revert: docs(capture): add spec for capture endpoints (#14961)"

This reverts commit 063dc98056.

* fix tests
2023-04-03 17:14:51 +00:00
Harry Waye
063dc98056 Revert: docs(capture): add spec for capture endpoints (#14961)
Revert "docs(capture): add spec for capture endpoints (#14957)"

This reverts commit b5ef61c0c5.
2023-04-03 16:32:03 +00:00
Harry Waye
b5ef61c0c5 docs(capture): add spec for capture endpoints (#14957)
* docs(capture): add spec for capture endpoints

This adds an OpenAPI specification for the capture endpoints. This is
useful for documenting the API, and further can be used e.g. in tests to
validate that both clients and the API are behaving as expected.
2023-04-03 11:44:29 +00: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
dependabot[bot]
4feea17102 chore(deps): bump wheel from 0.37.1 to 0.38.1 (#14558)
Bumps [wheel](https://github.com/pypa/wheel) from 0.37.1 to 0.38.1.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.37.1...0.38.1)

---
updated-dependencies:
- dependency-name: wheel
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
2023-03-14 15:25:31 +01: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
Paul D'Ambra
6c1141731e fix: botocore unexpectedly started using a mocked file operation (#14126) 2023-02-07 21:30:20 +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
Paul D'Ambra
6bbcdfdc3a chore: upgrade requests (#13020)
so that we upgrade urllib3 which sentry latest needs

Problem
running pip install -r ./requirements.txt worked fine

but running pip install -r ./requirements.txt && pip install -r ./requirements-dev.txt gave an error message

Installing collected packages: urllib3
  Attempting uninstall: urllib3
    Found existing installation: urllib3 1.26.13
    Uninstalling urllib3-1.26.13:
      Successfully uninstalled urllib3-1.26.13
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
sentry-sdk 1.11.1 requires urllib3>=1.26.11; python_version >= "3.6", but you have urllib3 1.26.5 which is incompatible.
Changes
Upgraded the requests library and regenerated the requirements files
2022-11-30 16:50:23 +00:00
Guido Iaquinti
db7d49feef fix(django): upgrade from 3.2.15 to 3.2.16 (#12402) 2022-10-24 15:11:58 +02: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