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

7 Commits

Author SHA1 Message Date
Tim Glaser
7da9287656
595 offload storing events to workers (#615)
* Adds to #595 move capture workload to tasks

* Move tests to tasks

* Move tests from api to tasks

* Finish moving tests around

* Closes #611 alias should find based on alias rather than distinct_id

* Make sure batch still works

* Add tests for slack
2020-04-17 15:38:17 +01:00
Sanket Dasgupta
3738f33e30
Remove drf-yasg in favor of new docs website (#596)
The new documentation at https://docs.posthog.com supersedes
this.

Fixes https://github.com/PostHog/posthog/issues/574
2020-04-15 16:24:10 +01:00
Tim Glaser
4782d54d1f
Configure mypy (#562)
* server/mypy: Enable no_implicit_optional

no_implicit_optional Changes the treatment of arguments with a default value of None by not implicitly making their type Optional.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#none-and-optional-handling

* server/mypy: Enable warn_unused_ignores

warn_unused_ignores: Warns about unneeded # type: ignore comments.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#configuring-warnings

It's best to exclude packages with no typing in mypy.ini rather than in
the code. This waym if tin the future these packages add types it's can
easily be disabled (by removing the exclusion in mypy.ini).

* api/user: Fix user password was not really validated

* api/test/base: Remove unreachable code

Team is created in setup, so no reason for it not to be there (unless
setUp is overriden by child, which as far as I can see is currently not
happening),

* server/mypy: Enable check_untyped_defs

check_untyped_defs: Type-checks the interior of functions without type annotations.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#untyped-definitions-and-calls

* server/mypy: Enable strict_equality

strict_equality: Prohibit equality checks, identity checks, and container checks between non-overlapping types.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#miscellaneous-strictness-flags

* server/mypy: Enable warn_unreachable

Added a fixme for a possible oversight in function that parses JSON.

warn_unreachable: Shows a warning when encountering any code
inferred to be unreachable or redundant after performing type
analysis.
Ref: https://mypy.readthedocs.io/en/stable/config_file.html#configuring-warnings

* api/posthog: fix possible bug when batch is not a list

Current code assumes batch is a valid list. If batch is not a list, the
capture handling will cause a 500 error.

* fix stricter mypy

* Use response.json instead of .data

Co-authored-by: Haki Benita <hakibenita@gmail.com>
2020-04-14 11:05:45 +01:00
Marius Andra
3ec4db5ce7 ignore celery for mypy 2020-04-07 14:02:09 +02:00
Tim Glaser
cf8995b574 Add GitLab API URL 2020-04-06 11:08:59 +01:00
Tim Glaser
5336c93658 Add posthog analytics module
- Make sure each user has a distinct id that we can pass
2020-02-10 13:18:01 -08:00
Tim Glaser
7b0b04f0ad Move api stuff around 2020-01-24 11:00:25 -08:00