Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #23 from openedx/bmtcril/fix_unicode
Browse files Browse the repository at this point in the history
fix: Unicode course data causes errors when sending to ClickHouse
  • Loading branch information
bmtcril authored Aug 3, 2023
2 parents ec75ed9 + a85722c commit 7ba7521
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:

push:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion event_sink_clickhouse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
A sink for Open edX events to send them to ClickHouse.
"""

__version__ = '0.1.0'
__version__ = '0.1.1'
4 changes: 2 additions & 2 deletions event_sink_clickhouse/sinks/course_published.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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
)
Expand Down
4 changes: 2 additions & 2 deletions test_utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7ba7521

Please sign in to comment.