Skip to content

Commit

Permalink
Merge pull request #429 from skalish/fix-record-updates
Browse files Browse the repository at this point in the history
TC: Quick fix to record record update function and tests.
  • Loading branch information
pcattori committed Aug 7, 2020
2 parents 763b658 + e9959ef commit 8eebaa7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tamr_client/dataset/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _update(session: Session, dataset: Dataset, updates: Iterable[Dict]) -> Json
Raises:
requests.HTTPError: If an HTTP error is encountered
"""
stringified_updates = (json.dumps(update) for update in updates)
stringified_updates = (json.dumps(update).encode("utf-8") for update in updates)
# `requests` accepts a generator for `data` param, but stubs for `requests` in https://github.com/python/typeshed expects this to be a file-like object
io_updates = cast(IO, stringified_updates)
r = session.post(
Expand Down
2 changes: 1 addition & 1 deletion tests/tamr_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def capture_payload(request, snoop, status, response_json):
See https://github.com/getsentry/responses#dynamic-responses
"""
snoop["payload"] = list(request.body)
snoop["payload"] = [x.decode("utf-8") for x in request.body]
return status, {}, json.dumps(response_json)


Expand Down

0 comments on commit 8eebaa7

Please sign in to comment.