Skip to content

Fix backend lint errors in PostgresConnector and statistics endpoint#293

Merged
cheezyrock merged 1 commit into
mainfrom
codex/fix-linting-errors-in-codebase
Apr 21, 2026
Merged

Fix backend lint errors in PostgresConnector and statistics endpoint#293
cheezyrock merged 1 commit into
mainfrom
codex/fix-linting-errors-in-codebase

Conversation

@cheezyrock
Copy link
Copy Markdown
Collaborator

Motivation

  • Resolve linting errors: C0321 (multiple-statements), E0203 (access-member-before-definition), and E1120 (missing parameter) reported for backend modules.

Description

  • Initialize PostgresConnector.connection to None in __init__ and simplify the connect() guard to avoid accessing the member before definition and ensure a clear connection check.
  • Expand single-line conditionals and inline statements in Backend/postgres_connector.py (rollback handling, polynomial monomial construction, and string concatenation branches) into multi-line blocks to satisfy C0321 style rules.
  • Update the /get_statistics route in Backend/server.py to call connector.build_where_text(filters) and pass both where_sql and params into connector.get_statistics() to supply the required arguments.

Testing

  • Successfully compiled the modified modules with python -m py_compile Backend/postgres_connector.py Backend/server.py.
  • Attempted to run pylint Backend/postgres_connector.py Backend/server.py but pylint is not available in the execution environment, so lint checks could not be re-run here.

Codex Task

@cheezyrock cheezyrock merged commit 1f3b85e into main Apr 21, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in dads - issue tracking Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

1 participant