Skip to content

feat: Implement General Dataset API with CRUD Operations#91

Merged
rbardaji merged 13 commits intomainfrom
feat/90-general-dataset-crud-endpoints
Jun 28, 2025
Merged

feat: Implement General Dataset API with CRUD Operations#91
rbardaji merged 13 commits intomainfrom
feat/90-general-dataset-crud-endpoints

Conversation

@rbardaji
Copy link
Copy Markdown
Collaborator

📋 Description

This PR introduces a comprehensive General Dataset API with full CRUD operations, including support for groups, comprehensive testing, and documentation.

🚀 Features Added

API Endpoints

  • POST /dataset - Create new dataset
  • PUT /dataset/{dataset_id} - Update entire dataset
  • PATCH /dataset/{dataset_id} - Partial dataset update

Core Components

  • Models: Request and response models for dataset operations
  • Services: Business logic for dataset management
  • Groups Support: Integration with groups functionality
  • Error Handling: Robust error management and validation

Quality Assurance

  • Test Coverage: Achieved 70% test coverage milestone
  • Code Quality: All code passes flake8 linting
  • Documentation: Added comprehensive tutorial with Colab and Binder integration

🔧 Technical Details

Files Modified/Added

  • Dataset request/response models
  • General dataset service functions
  • API endpoint implementations
  • Comprehensive test suite
  • Tutorial documentation

Testing

  • ✅ Comprehensive service tests implemented
  • ✅ 70% test coverage achieved
  • ✅ All tests passing
  • ✅ Code quality checks (flake8) passing

📚 Documentation

  • Added detailed tutorial with examples
  • Integrated with Google Colab for easy testing
  • Added Binder support for interactive exploration

🔍 Code Quality

  • All code follows PEP-8 standards
  • Maximum line length: 79 characters
  • Comprehensive English comments
  • Proper error handling and validation

📊 Metrics

  • Test Coverage: 70%
  • Code Quality: ✅ Passes flake8
  • API Endpoints: 3 new endpoints
  • Documentation: Tutorial + examples

📝 Checklist

  • Code follows PEP-8 standards
  • All tests pass
  • Test coverage >= 70%
  • Documentation updated
  • Code quality checks pass
  • Examples provided in tutorial

rbardaji added 13 commits June 27, 2025 15:58
- Add ResourceRequest model for flexible resource definitions
- Add GeneralDatasetRequest for dataset creation
- Add GeneralDatasetUpdateRequest for partial updates
- Include comprehensive field validation and documentation
- Add ResourceResponse model for resource data in responses
- Add GeneralDatasetResponse for complete dataset information
- Include timestamps and metadata fields for comprehensive responses
- Add create_general_dataset for flexible dataset creation
- Add update_general_dataset for full dataset replacement
- Add patch_general_dataset for partial updates
- Include comprehensive validation and error handling
- Add general dataset creation endpoint with flexible schema
- Support local and pre_ckan server selection
- Include comprehensive validation and error handling
- Add detailed API documentation with examples
- Add general dataset update endpoint for full replacement
- Support local and pre_ckan server selection
- Include comprehensive error handling for 404 and validation errors
- Add detailed API documentation with usage examples
- Add general dataset partial update endpoint
- Support merging of extras with existing metadata
- Include comprehensive error handling and validation
- Add detailed documentation explaining partial update behavior
- Ensure register_router includes general dataset creation
- Ensure update_router includes general dataset updates
- Verify endpoints are properly exposed in API
- Add groups field to request and response models
- Update service functions to handle groups parameter
- Modify all three endpoints (POST, PUT, PATCH) to support groups
- Groups are formatted as CKAN expects: [{"name": "group_name"}]
- Add full test coverage for create_general_dataset function
- Add tests for update_general_dataset with field merging
- Add tests for patch_general_dataset delegation
- Test parameter validation, error handling, and CKAN instance selection
- Cover extras validation, reserved keys, and resource creation
- Restore 70%+ test coverage after new files addition
- Add comprehensive tests for general_dataset service (74 lines, 8% → ~95%)
- Add tests for post_general_dataset route (36 lines, 28% → ~85%)
- Cover create/update/patch dataset operations with full validation
- Test error handling for duplicate datasets, server config, and validation
- Test pre_ckan vs local server selection and field validation
- Restore 70%+ coverage after new general dataset files addition
- Total improvement: 69% → 70%+ test coverage
@rbardaji rbardaji merged commit 6831d24 into main Jun 28, 2025
2 checks passed
@rbardaji rbardaji deleted the feat/90-general-dataset-crud-endpoints branch June 28, 2025 22:05
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.

1 participant