Skip to content

feat: Re-implement CSV download functionality and fix test failures #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 12, 2025

Conversation

jeffreyaven
Copy link
Member

Add --csv-download argument to %%stackql cell magic command that enables CSV download links for query results with comprehensive test coverage.

Changes

  • Add --csv-download argument to both local and server magic classes
  • Implement CSV generation using pandas DataFrame.to_csv()
  • Create HTML download links using base64-encoded data URIs
  • Add styled download buttons with error handling
  • Feature only works when --no-display is not set (default behavior)
  • Add comprehensive tests for both local and server modes covering:
    • CSV download functionality
    • --no-display precedence behavior
    • HTML generation and base64 encoding
    • Error handling for CSV generation failures
  • Fix test mocking to target IPython.display directly instead of module attributes

Resolves #18

claude bot and others added 4 commits June 12, 2025 00:09
Add --csv-download argument to %%stackql cell magic command that enables
CSV download links for query results with comprehensive test coverage.

## Changes
- Add --csv-download argument to both local and server magic classes
- Implement CSV generation using pandas DataFrame.to_csv()
- Create HTML download links using base64-encoded data URIs
- Add styled download buttons with error handling
- Feature only works when --no-display is not set (default behavior)
- Add comprehensive tests for both local and server modes covering:
  * CSV download functionality
  * --no-display precedence behavior
  * HTML generation and base64 encoding
  * Error handling for CSV generation failures
- Fix test mocking to target IPython.display directly instead of module attributes

Resolves #18

Co-authored-by: jeffreyaven <[email protected]>
@jeffreyaven jeffreyaven merged commit 4ddb831 into main Jun 12, 2025
16 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.

[FEATURE] Add csv download for Jupyter notebook cells
1 participant