refactor: Reduce code duplication in vendors/ directory#56
Open
refactor: Reduce code duplication in vendors/ directory#56
Conversation
- Add _load_and_validate_config() to eliminate duplicate config loading - Add _get_aws_credentials() to centralize AWS credential extraction - Replace 4 instances of duplicate config loading logic across CLI commands - Reduce code duplication by ~40 lines while maintaining exact functionality Co-Authored-By: Claude <noreply@anthropic.com>
Major refactoring to improve code clarity and reduce duplication: - Add DuckDBS3Reader class with context management for unified CSV/Parquet reading - Remove duplicate read_csv_file() and read_parquet_file() functions - Extract _run_single_table_strategy() and _run_separate_tables_strategy() - Reduce run_aws_pipeline() from 325 lines to 40 lines with clear strategy delegation - Consolidate record cleaning logic into single _clean_record() method - Remove ~270 lines of duplicate connection and processing logic All tests pass with zero functionality changes.
- Add comprehensive documentation for CLI coordinator class - Enhance error messages for missing vendors with helpful suggestions - Improve code clarity with better comments and structure - Maintain backward compatibility with existing functionality Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Exclude serena development artifacts from version control. Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive refactoring of the vendors/ directory to eliminate code duplication and improve clarity. Enhanced CLI plugin discovery system with better error handling and developer experience.
Net result: Reduced codebase by ~270 lines while improving functionality and maintainability.
Changes Made
CLI Plugin Discovery Enhancement
AWS Pipeline Refactoring
DuckDBS3Readerclass and context managementrun_aws_pipeline()from 325 lines to 40 lines_clean_record()methodCLI Helper Functions
_load_and_validate_config()and_get_aws_credentials()Development Hygiene
Test Results
All tests pass with zero functionality changes:
Impact
This refactoring follows the CLAUDE.md principle of clarity over cleverness, making the codebase significantly easier to understand and maintain.
Generated with Claude Code