Skip to content

Conversation

@chezou
Copy link
Member

@chezou chezou commented Oct 31, 2025

Ensure code quality with introducing I, UP, B rules.

Merge after #138

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=2 parameter to warnings.warn() calls for better warning source location
  • Replaces explicit iterator loops with yield from statements for cleaner generator delegation
  • Replaces deprecated socket.error with OSError
  • Adds from None to 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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@tung-vu-td tung-vu-td left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chezou chezou merged commit 62add3d into type-hint Nov 3, 2025
22 checks passed
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.

3 participants