Skip to content

feat: Implement DataFrame API endpoints and core backend services #460

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 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .kiro/specs/dataframe-web-interface/tasks.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Implementation Plan

- [ ] 1. Create DataFrame API endpoints and core backend services
- [x] 1. Create DataFrame API endpoints and core backend services
- Implement RESTful API endpoints for DataFrame management operations
- Create business logic layer for data validation and processing
- Set up error handling and response formatting
- _Requirements: 1.1, 1.2, 1.3, 1.4, 5.1, 5.2, 5.3, 7.1, 7.2, 7.4_

- [ ] 1.1 Implement DataFrame API module structure
- [x] 1.1 Implement DataFrame API module structure
- Create `server/api/dataframes.py` with all endpoint function stubs
- Add DataFrame routes to `server/api/__init__.py`
- Create request/response models and validation schemas
- _Requirements: 1.1, 5.1_

- [ ] 1.2 Implement DataFrame listing and metadata endpoints
- [x] 1.2 Implement DataFrame listing and metadata endpoints
- Code GET `/api/dataframes` endpoint to list all stored DataFrames
- Code GET `/api/dataframes/{df_id}` endpoint for individual DataFrame details
- Code GET `/api/dataframes/stats` endpoint for storage statistics
- Implement pagination and filtering logic for DataFrame lists
- _Requirements: 1.1, 1.2, 1.3, 7.1, 7.2_

- [ ] 1.3 Implement DataFrame data retrieval endpoints
- [x] 1.3 Implement DataFrame data retrieval endpoints
- Code GET `/api/dataframes/{df_id}/data` endpoint with pagination support
- Code GET `/api/dataframes/{df_id}/summary` endpoint for DataFrame summaries
- Implement data serialization and formatting for web display
- Add support for column filtering and row limiting
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5_

- [ ] 1.4 Implement DataFrame operation execution endpoints
- [x] 1.4 Implement DataFrame operation execution endpoints
- Code POST `/api/dataframes/{df_id}/execute` endpoint for pandas expressions
- Implement expression validation and sanitization
- Add execution time tracking and result formatting
Expand Down
27 changes: 27 additions & 0 deletions server/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@

from .visualizations import visualization_api

from .dataframes import (
api_list_dataframes,
api_get_dataframe_detail,
api_get_storage_stats,
api_get_dataframe_data,
api_get_dataframe_summary,
api_execute_dataframe_operation,
api_delete_dataframe,
api_cleanup_expired_dataframes,
api_upload_dataframe,
api_load_dataframe_from_url,
api_export_dataframe,
)

# Aggregate all routes into a single list
api_routes = [
# Knowledge management endpoints
Expand Down Expand Up @@ -98,4 +112,17 @@
Route("/api/visualizations/execution-timeline", endpoint=visualization_api.get_execution_timeline, methods=["GET"]),
Route("/api/visualizations/critical-path", endpoint=visualization_api.get_critical_path, methods=["GET"]),
Route("/api/visualizations/status-overview", endpoint=visualization_api.get_status_overview, methods=["GET"]),

# DataFrame management endpoints - specific routes first, then generic ones
Route("/api/dataframes", endpoint=api_list_dataframes, methods=["GET"]),
Route("/api/dataframes/stats", endpoint=api_get_storage_stats, methods=["GET"]),
Route("/api/dataframes/cleanup", endpoint=api_cleanup_expired_dataframes, methods=["POST"]),
Route("/api/dataframes/upload", endpoint=api_upload_dataframe, methods=["POST"]),
Route("/api/dataframes/load-url", endpoint=api_load_dataframe_from_url, methods=["POST"]),
Route("/api/dataframes/{df_id}", endpoint=api_get_dataframe_detail, methods=["GET"]),
Route("/api/dataframes/{df_id}", endpoint=api_delete_dataframe, methods=["DELETE"]),
Route("/api/dataframes/{df_id}/data", endpoint=api_get_dataframe_data, methods=["GET"]),
Route("/api/dataframes/{df_id}/summary", endpoint=api_get_dataframe_summary, methods=["GET"]),
Route("/api/dataframes/{df_id}/execute", endpoint=api_execute_dataframe_operation, methods=["POST"]),
Route("/api/dataframes/{df_id}/export", endpoint=api_export_dataframe, methods=["POST"]),
]
Loading