Skip to content

Add gzip format for datastore dumps#12

Merged
sagargg merged 1 commit into
mainfrom
add-gzip-dump-format
Jul 14, 2026
Merged

Add gzip format for datastore dumps#12
sagargg merged 1 commit into
mainfrom
add-gzip-dump-format

Conversation

@luccasmmg

@luccasmmg luccasmmg commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add format=gzip support for /datastore/dump/{resource_id} as gzipped CSV
  • export gzip dumps from BigQuery as CSV with compression='GZIP'
  • stream multi-shard gzip dumps by decompressing shards, de-duping CSV headers, and recompressing as one gzip file

Tests

  • uv run --extra dev pytest tests/test_datastore_dump.py
  • uv run --extra dev ruff check datastore/api/endpoints/dump.py datastore/services/dump.py datastore/infrastructure/engines/bigquery/backend.py tests/test_datastore_dump.py

Summary by CodeRabbit

  • New Features

    • Added support for exporting datastore resources as gzip-compressed CSV files.
    • Gzip exports support multi-shard results, combine data into a single download, and remove duplicate CSV headers.
    • Downloads use the appropriate .csv.gz filename and content type.
  • Bug Fixes

    • Improved handling of oversized exports across supported export formats.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a4073beb-c4b4-42ec-ab99-367572b9e046

📥 Commits

Reviewing files that changed from the base of the PR and between e1fcafd and 264f9cb.

📒 Files selected for processing (4)
  • datastore/api/endpoints/dump.py
  • datastore/infrastructure/engines/bigquery/backend.py
  • datastore/services/dump.py
  • tests/test_datastore_dump.py
 _____________________________________________
< My middle name? 'Bugfinder Extraordinaire.' >
 ---------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-gzip-dump-format

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@sagargg sagargg merged commit bb9e761 into main Jul 14, 2026
2 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