Skip to content

Write split db-report downloads as a zip#16

Draft
jiatolentino wants to merge 1 commit into
datamasque:mainfrom
jiatolentino:db-report-zip-download
Draft

Write split db-report downloads as a zip#16
jiatolentino wants to merge 1 commit into
datamasque:mainfrom
jiatolentino:db-report-zip-download

Conversation

@jiatolentino

@jiatolentino jiatolentino commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

dm discover db-report now handles the split-zip format: when the server returns a zip of CSV parts, the CLI writes it as a binary .zip instead of mangling it as text.

Background

Large discovery reports are now split server-side into a zip of numbered CSV parts (datamasque DM-3165). datamasque-python's get_db_discovery_result_report returns bytes for that case.

What changed

  • db-report branches on the client return type:
    • str (CSV) → unchanged (write to -o, or echo to stdout).
    • bytes (zip) → write the binary archive, correcting a non-.zip output path to .zip. Requires -o (a binary zip can't be streamed to stdout); aborts with a clear hint otherwise.

Testing

  • pytest tests/commands/test_discovery.py — added split-zip and no-output abort tests.
  • ruff, ruff format, mypy clean.

Dependency

  • Depends on datamasque-python returning bytes for split reports (companion PR). Bump the minimum datamasque-python pin once that release is cut — otherwise an older client returns corrupt text against a new server.

@jiatolentino jiatolentino self-assigned this Jun 17, 2026
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