Skip to content

Commit

Permalink
fix(batch-exports): Escape again (#25078)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias authored Sep 19, 2024
1 parent 34ef9a3 commit ded7c2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions posthog/temporal/batch_exports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def as_py(self) -> dict | None:
except orjson.JSONDecodeError:
pass

json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("utf-8")
json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("unicode-escape")
try:
return orjson.loads(json_bytes)
except orjson.JSONDecodeError:
Expand All @@ -154,7 +154,7 @@ def as_py(self) -> dict | None:
# Handles non-valid JSON strings like `'"$set": "Something"'` by quoting them.
value = f'"{value}"'

json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("utf-8")
json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("unicode-escape")
try:
return orjson.loads(json_bytes)
except orjson.JSONDecodeError:
Expand Down

0 comments on commit ded7c2a

Please sign in to comment.