Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the Python codebase by applying various linting and code quality improvements. The changes update older Python idioms to their modern equivalents, improve code clarity, and enhance the CI/CD pipeline.
- Replaces old-style
%string formatting with f-strings throughout the codebase - Updates
super()calls to use the argument-free form available in Python 3+ - Adds
stacklevel=2parameter towarnings.warn()calls for better warning source location - Replaces explicit iterator loops with
yield fromstatements for cleaner generator delegation - Replaces deprecated
socket.errorwithOSError - Adds
from Noneto exception chains where appropriate to suppress context - Reorders imports alphabetically (alphabetically within import groups)
- Updates Ruff linting configuration to enable additional rule sets (W, I, UP, B)
- Restructures GitHub Actions workflow to run linting checks in a separate job
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tdclient/util.py | Updated string formatting to f-strings, added stacklevel to warnings, replaced explicit loop with yield from, sorted imports |
| tdclient/user_model.py | Modernized super() call |
| tdclient/table_model.py | Modernized super() call and updated string formatting to f-strings |
| tdclient/table_api.py | Updated string formatting to f-strings |
| tdclient/server_status_api.py | Updated string formatting to f-strings |
| tdclient/schedule_model.py | Modernized super() calls |
| tdclient/result_model.py | Modernized super() call |
| tdclient/result_api.py | Sorted imports |
| tdclient/job_model.py | Modernized super() call and added stacklevel to warnings |
| tdclient/job_api.py | Updated string formatting to f-strings, replaced explicit loop with yield from, removed blank line |
| tdclient/export_api.py | Sorted imports |
| tdclient/database_model.py | Modernized super() call |
| tdclient/cursor.py | Updated string formatting to f-strings |
| tdclient/connector_api.py | Updated string formatting to f-strings |
| tdclient/client.py | Updated string formatting to f-strings, replaced explicit loops with yield from, sorted imports, removed blank line |
| tdclient/bulk_import_model.py | Modernized super() call, updated string formatting to f-strings, replaced explicit loop with yield from |
| tdclient/bulk_import_api.py | Updated string formatting to f-strings, replaced explicit loop with yield from |
| tdclient/api.py | Updated string formatting to f-strings, replaced socket.error with OSError, added error chaining with from None/from error, removed socket import, removed blank line |
| pyproject.toml | Added W, I, UP, and B rule sets to Ruff linting configuration |
| docs/conf.py | Updated string formatting to f-strings |
| .github/workflows/pythontest.yml | Created separate lint job and moved pyright check from test job to lint job |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Ensure code quality with introducing I, UP, B rules.
Merge after #138