Skip to content

fix: resolve typecheck failures in .load command and tests utils#251

Merged
amjith merged 2 commits intomainfrom
codex/fix-typecheck-failure-in-dbcommands.py
Feb 15, 2026
Merged

fix: resolve typecheck failures in .load command and tests utils#251
amjith merged 2 commits intomainfrom
codex/fix-typecheck-failure-in-dbcommands.py

Conversation

@amjith
Copy link
Member

@amjith amjith commented Feb 15, 2026

Motivation

  • Fix CI typecheck errors: the .load special command returned a value despite being annotated -> None, and tests included an unused # type: ignore suppression.

Description

  • Removed the stray return [(None, None, None, "")] from load_extension in litecli/packages/special/dbcommands.py and removed the unused # type: ignore[attr-defined] comment from tests/utils.py.

Testing

  • Performed pip install -e ., ran ruff check litecli/packages/special/dbcommands.py tests/utils.py which passed, and ran pytest -q tests/test_dbspecial.py which completed successfully (9 passed); attempted ty check but the ty tool was not available in the environment.

Codex Task

@github-actions
Copy link

Findings (blocking)

  1. .load now returns None, but sqlexecute iterates the result of special.execute. This will raise TypeError: 'NoneType' object is not iterable the first time .load is executed. This is a runtime regression.
    File: litecli/packages/special/dbcommands.py:249 (removal of return) and litecli/sqlexecute.py:146 (iteration).
    Fix options:
  • Keep load_extension returning an empty list (e.g., return []) and update its return annotation to list[tuple] for consistency with other special commands.
  • Or update special.execute / the caller to tolerate None results (larger change, needs broader audit).

Missing tests / edge cases

  1. No test coverage for .load in tests/. A minimal test should assert .load succeeds and yields no rows (but also does not crash) when given a valid extension path. Right now this regression would have been caught by a simple .load invocation.

Everything else in this PR is fine; the tests/utils.py change is harmless.

Residual risk: If you choose the “return None” approach, you need to confirm all other special commands are safe with None and that any iterators over results handle it.

@github-actions
Copy link

No correctness, security, or regression issues found in the actual diff.

Notes:

  • The final commit keeps the .load return value and updates the annotation to list[tuple]. This matches the execute contract in litecli/packages/special/main.py which always expects a list return. The PR description currently states the return was removed, which doesn’t match the final code. Consider updating the PR text so reviewers aren’t misled.

Tests: No additional tests seem necessary for this change.

@amjith
Copy link
Member Author

amjith commented Feb 15, 2026

@codex review

@amjith amjith merged commit 2b1d873 into main Feb 15, 2026
9 of 10 checks passed
@amjith amjith deleted the codex/fix-typecheck-failure-in-dbcommands.py branch February 15, 2026 01:50
@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant