Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PostHog compatibile with Python 3.9 #1987

Merged
merged 6 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 1

- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.8

Expand Down Expand Up @@ -62,8 +62,11 @@ jobs:
mypy posthog ee

django:
name: Django tests
name: Django tests (${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', 'pypy3']

services:
postgres:
Expand All @@ -86,10 +89,10 @@ jobs:
with:
fetch-depth: 1

- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v1
with:
Expand Down Expand Up @@ -231,7 +234,7 @@ jobs:
fetch-depth: 1

- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.8

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v1
Expand Down
2 changes: 1 addition & 1 deletion posthog/queries/test/test_trends.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_breakdown_filtering(self):

self.assertEqual(sum(response[0]["data"]), 2)
self.assertEqual(response[0]["data"][4 + 7], 2)
self.assertEqual(response[0]["breakdown_value"], "None")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will possibly mess stuff up in the frontend?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found any comparison to 'None' in the frontend code base, so think this shouldn't affect it (unless I'm missing some value handling somewhere).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appUrlsLogic.js:45 relies on it being true/false (rather than 'nan'), same for trendsLogic.js:100.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it was a truthy string anyway though, as in "None", not None.

self.assertEqual(response[0]["breakdown_value"], "nan")

self.assertEqual(sum(response[1]["data"]), 1)
self.assertEqual(response[1]["data"][5 + 7], 1)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MarkupSafe==1.1.1
monotonic==1.5
numpy==1.18.1
oauthlib==3.1.0
pandas==1.0.3
pandas==1.1.3
parso==0.6.1
pexpect==4.7.0
pickleshare==0.7.5
Expand Down