Skip to content

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

2 participants