Skip to content

Write split db-report downloads as a zip#16

Merged
jiatolentino merged 1 commit into
datamasque:mainfrom
jiatolentino:db-report-zip-download
Jul 17, 2026
Merged

Write split db-report downloads as a zip#16
jiatolentino merged 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
@jiatolentino
jiatolentino requested a review from alxboyle June 18, 2026 02:13
@jiatolentino
jiatolentino marked this pull request as ready for review June 18, 2026 02:13
@jiatolentino
jiatolentino requested review from carlosfunk and removed request for alxboyle June 22, 2026 22:01
Comment thread src/datamasque_cli/commands/discovery.py Outdated
@jiatolentino
jiatolentino force-pushed the db-report-zip-download branch from 91b654c to 68a5147 Compare June 22, 2026 23:42
@jiatolentino
jiatolentino requested a review from carlosfunk June 22, 2026 23:48
@jiatolentino
jiatolentino merged commit b71df6f into datamasque:main Jul 17, 2026
5 checks passed
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