Skip to content

fix: check compression value before downloading - #130

Open
TejasKumat8 wants to merge 1 commit into
dbpedia:mainfrom
TejasKumat8:fix/validate-download-compression
Open

TejasKumat8 wants to merge 1 commit into
dbpedia:mainfrom
TejasKumat8:fix/validate-download-compression

Conversation

@TejasKumat8

Copy link
Copy Markdown
Contributor

Pull Request

Description

Fixes the crash from #129. download() now lowercases compression and rejects unknown values at the start, before any request is made. The CLI already did this through click.Choice, but workflow steps and direct API calls didn't, so GZ or zip ended in a KeyError after the file was downloaded.

Now in a workflow compression: GZ works like gz, and compression: zip fails right away with:

Unsupported compression: zip. Supported: ['bz2', 'gz', 'xz', 'none']

None and "" still mean no conversion, same as before.

Added tests/test_download_compression_option.py (12 tests, requests faked). The two download() tests check that zip makes no HTTP call and writes no file, and that GZ gives a real .gz file.

Related Issues
Fixes #129

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • Housekeeping

Checklist:

  • My code follows the ruff code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
    • pytest - 290 passed, 3 skipped
    • ruff check - no linting errors

I didn't bump the version since recent fixes like #101 didn't either, but happy to add it.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 081239df-cb27-420d-b2d5-34295604a930
Commits

Reviewing files that changed from the base of the PR and between b35bd2c and 1f945a2.

Files selected for processing: 2

  • databusclient/api/download.py
  • tests/test_download_compression_option.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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.

bug: workflow download crashes with KeyError for uppercase or unknown compression value

1 participant