Code cleanup: Ruff linting improvements - #41
Open
anthonypdawson wants to merge 6 commits into
Open
anthonypdawson wants to merge 6 commits into
anthonypdawson wants to merge 6 commits into
Conversation
Fixes metadata display for LanceDB databases with flat schemas (e.g., Contextus) where metadata is stored as individual columns rather than nested in a 'metadata' column. ## Changes ### LanceDB Connection - Extract metadata from PyArrow schema first (all non-reserved columns) - Support flat schema format in get_all_items() - build metadata dicts from column values - Detect and exclude content column from metadata to prevent duplication - Maintain backward compatibility with nested 'metadata' column format - Fix count detection when schema extraction succeeds but count is unavailable ### UI - Add 600px max-width constraint to table columns to prevent excessive width - Prevent 'document' column from appearing twice (once as content, once as metadata) ### Tests - Add comprehensive flat schema metadata extraction tests - Update existing tests to reflect content column exclusion from metadata - Verify backward compatibility with nested metadata format Closes #XX
- Enable CI test workflow on all PRs to master/main - Add new lint workflow with ruff (check + format) - Linting is advisory-only (won't block merges) until codebase is cleaned up - Tests remain blocking as expected
- Update RELEASE_REASON.md to v0.8.4 (matches CHANGELOG and pyproject.toml) - Add permissions blocks to CI workflows per GitHub security recommendation
- Added ignore rules for ARG* (unused args required for interfaces) - Added ignore rules for test-specific patterns (E741, RUF003, DTZ005) - Applied ruff auto-fixes (--fix + --unsafe-fixes) - Formatted all code with ruff format - Fixed unused import in __init__.py Remaining 39 violations are edge cases that need manual review. Will address in follow-up commits before enabling blocking lint.
This branch has not been deployed
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
Massive code quality improvement reducing lint violations from 1830 to 39 (97.9% reduction).
Changes
Ignored intentional patterns:
Auto-fixed 95+ safe violations
Applied unsafe fixes for formatting consistency
Formatted all code with
ruff format(44 files reformatted)Manual fix: Removed unused
PackageNotFoundErrorimport in__init__.pyRemaining Work
39 edge-case violations remain for manual review:
These will be addressed in follow-up commits before enabling blocking lint enforcement.
Testing
continue-on-error: truein workflow)Next Steps
continue-on-errorfrom lint.yml to make it blockingCloses part of the technical debt from initial PR #40 setup.