From a9b6ce93199c07bbbf0be3b66f245d6c7c24fe11 Mon Sep 17 00:00:00 2001 From: Brian Mesick Date: Thu, 3 Aug 2023 09:55:36 -0400 Subject: [PATCH 1/3] fix: Unicode course data caused errors in requests --- event_sink_clickhouse/sinks/course_published.py | 4 ++-- test_utils/helpers.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/event_sink_clickhouse/sinks/course_published.py b/event_sink_clickhouse/sinks/course_published.py index 6208e6f..926306b 100644 --- a/event_sink_clickhouse/sinks/course_published.py +++ b/event_sink_clickhouse/sinks/course_published.py @@ -245,7 +245,7 @@ def _send_course_overview(self, serialized_overview): request = requests.Request( 'POST', self.ch_url, - data=output.getvalue(), + data=output.getvalue().encode("utf-8"), params=params, auth=self.ch_auth ) @@ -270,7 +270,7 @@ def _send_xblocks(self, serialized_xblocks): request = requests.Request( 'POST', self.ch_url, - data=output.getvalue(), + data=output.getvalue().encode("utf-8"), params=params, auth=self.ch_auth ) diff --git a/test_utils/helpers.py b/test_utils/helpers.py index fa57d6c..5992440 100644 --- a/test_utils/helpers.py +++ b/test_utils/helpers.py @@ -201,7 +201,7 @@ def check_overview_csv_matcher(course_overview): def match(request): body = request.body - f = StringIO(body) + f = StringIO(body.decode("utf-8")) reader = csv.reader(f) i = 0 @@ -251,7 +251,7 @@ def check_block_csv_matcher(course): that actually does the matching. """ def match(request): - body = request.body + body = request.body.decode("utf-8") lines = body.split("\n")[:-1] # There should be one CSV line for each block in the test course From aed339e0e13237197e2d8c717d466494cb9dee59 Mon Sep 17 00:00:00 2001 From: Brian Mesick Date: Thu, 3 Aug 2023 10:52:10 -0400 Subject: [PATCH 2/3] chore: Bump version --- event_sink_clickhouse/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/event_sink_clickhouse/__init__.py b/event_sink_clickhouse/__init__.py index eae5234..428efa2 100644 --- a/event_sink_clickhouse/__init__.py +++ b/event_sink_clickhouse/__init__.py @@ -2,4 +2,4 @@ A sink for Open edX events to send them to ClickHouse. """ -__version__ = '0.1.0' +__version__ = '0.1.1' From a85722c07efbed4262761f3fe8b9b5924503bca9 Mon Sep 17 00:00:00 2001 From: Brian Mesick Date: Thu, 3 Aug 2023 11:16:27 -0400 Subject: [PATCH 3/3] chore: Update gh actions runners to ubuntu-latest --- .github/workflows/ci.yml | 2 +- .github/workflows/pypi-publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80cc1d5..65e23e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-latest] python-version: ['3.8'] toxenv: [quality, docs, pii_check, django32, django40] diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index a22e9e6..b25f38d 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -7,7 +7,7 @@ on: jobs: push: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout