FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: preserve Unicode separators in NDJSON exports by MarshalMutisi · Pull Request #42 · prooflinedev/sdk-python · GitHub

Repository navigation

fix: preserve Unicode separators in NDJSON exports - #42

Open
MarshalMutisi wants to merge 1 commit into
prooflinedev:mainfrom
MarshalMutisi:fix/ndjson-unicode-line-separators
Open

MarshalMutisi wants to merge 1 commit into
prooflinedev:mainfrom
MarshalMutisi:fix/ndjson-unicode-line-separators

Conversation

Copy link
Copy Markdown

Problem

The NDJSON export decoder used Python's str.splitlines() to separate records. This method also splits on Unicode characters such as U+0085, U+2028, and U+2029, even when they occur inside valid JSON string values.

As a result, valid NDJSON responses could fail to decode, potentially losing exported records and pagination information.

Solution

Changed the NDJSON parser to split only on the LF (\n) record delimiter, preserving Unicode line-separator characters inside JSON strings.

Added a regression test covering U+0085, U+2028, and U+2029 in both synchronous and asynchronous client modes. The test verifies that the string values and pagination cursor are preserved.

Verification

  • Full test suite: 138 passed
  • Ruff lint: passed
  • Ruff format check: passed
  • Mypy: passed
  • git diff --check: passed

The regression test was also verified to fail before the fix and pass after it.

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL