Skip to content

Fix NDJSON export dataset version validation - #46

Open
angeliqueeumwali wants to merge 2 commits into
prooflinedev:mainfrom
angeliqueeumwali:contribution/python-sdk-improvement
Open

angeliqueeumwali wants to merge 2 commits into
prooflinedev:mainfrom
angeliqueeumwali:contribution/python-sdk-improvement

Conversation

@angeliqueeumwali

Copy link
Copy Markdown

Summary

Fixes dataset version validation in decode_export().

Previously, NDJSON responses containing "dataset_version": "1" (a string) were incorrectly accepted because the value was converted to a string before validation.

The decoder now validates dataset versions according to the response format:

  • CSV requires the string value "1".
  • NDJSON requires the integer value 1.
  • Non-object rows and invalid dataset versions are rejected.

Tests

Added a regression test covering both synchronous and asynchronous clients. It verifies that an NDJSON response with a string dataset version raises the expected ProoflineError with type urn:proofline:sdk:invalid-response.

Validation results:

  • 142 tests passed.
  • Ruff checks passed.
  • Mypy passed (198 source files).
  • git diff --check passed.

mohsen1 commented Nov 17, 2026

Copy link
Copy Markdown
Member

Codex review: This now conflicts with the export fixes merged today. Please retain LF-only NDJSON splitting, case-insensitive media types and the bounded CSV parser while applying strict dataset-version validation, then rerun scripts/check.py.

@angeliqueeumwali

Copy link
Copy Markdown
Author

Codex review: This now conflicts with the export fixes merged today. Please retain LF-only NDJSON splitting, case-insensitive media types and the bounded CSV parser while applying strict dataset-version validation, then rerun scripts/check.py.

Hi, I've updated PR #46 to incorporate the latest changes from main, preserved the requested export behavior, and rerun scripts/check.py successfully.

The GitHub Actions workflow is currently awaiting maintainer approval. Could someone please approve the workflow so the required checks can run?

Thank you!

@angeliqueeumwali

angeliqueeumwali commented Nov 17, 2026 via email

Copy link
Copy Markdown
Author

This branch has not been deployed

No deployments
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.

2 participants