Skip to content

Modernize - phase 4 - types update - #106

Merged
khoroshevskyi merged 2 commits into
modernize_1from
modernize_p4
Feb 26, 2026
Merged

khoroshevskyi merged 2 commits into
modernize_1from
modernize_p4

Conversation

@khoroshevskyi

@khoroshevskyi khoroshevskyi commented Feb 16, 2026 •

Copy link
Copy Markdown
Member

Changes:

  • Updated all type annotations to modern Python 3.10+ syntax (Union → |, List → list, Dict → dict, Optional → | None)
  • Fixed bug in UsageModel where type annotations were incorrectly used as default values
  • Replaced print statements with proper logging calls (_LOGGER.info/error)
  • Applied SQLAlchemy best practices using .is_(False) instead of == False for boolean comparisons
  • Added missing return type annotations and parameter type annotations
  • Removed unused imports and unnecessary f-string prefixes
  • Minor code cleanup (blank lines, import ordering)

TODO:

  • Version of pepdbagent updated in __version__.py file
  • Changelog updated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request modernizes type annotations across the bbconf codebase as part of a phased modernization effort. It updates all type hints to use Python 3.10+ syntax, replacing typing.Union with the pipe operator (|) and using built-in generic types (list, dict) instead of their typing module equivalents.

Changes:

  • Updated all type annotations to modern Python 3.10+ syntax (Union → |, List → list, Dict → dict, Optional → | None)
  • Fixed bug in UsageModel where type annotations were incorrectly used as default values
  • Replaced print statements with proper logging calls (_LOGGER.info/error)
  • Applied SQLAlchemy best practices using .is_(False) instead of == False for boolean comparisons
  • Added missing return type annotations and parameter type annotations
  • Removed unused imports and unnecessary f-string prefixes
  • Minor code cleanup (blank lines, import ordering)

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bbconf/models/drs_models.py Updated DRS model type annotations to modern syntax
bbconf/models/bedset_models.py Updated bedset model type annotations to modern syntax
bbconf/models/bed_models.py Updated bed model type annotations to modern syntax
bbconf/models/base_models.py Updated base model type annotations; fixed UsageModel default value bug
bbconf/db_utils.py Updated function signature type annotations; kept Optional for SQLAlchemy Mapped types
bbconf/config_parser/models.py Updated config model type annotations to modern syntax
bbconf/config_parser/bedbaseconfig.py Updated type annotations, added BaseClient import, removed unnecessary f-strings
bbconf/config_parser/utils.py Replaced print with _LOGGER calls, removed BedBaseConfError wrapper
bbconf/modules/objects.py Updated type annotations, added missing return type annotation
bbconf/modules/bedsets.py Updated type annotations, removed blank lines
bbconf/modules/bedfiles.py Updated type annotations, applied .is_(False) pattern, replaced print with logging, added deletion success log
bbconf/bbagent.py Updated type annotations, added return type for get_list_assays
bbconf/init.py Added blank line for PEP 8 compliance
pyproject.toml Added manual_testing.py to ruff exclude list
tests/conftest.py Removed unused imports (subprocess, register)
tests/test_common.py Removed unused BedBaseConfError import
tests/test_bedfile.py Removed unnecessary blank line
tests/test_universes.py Removed unnecessary blank line

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@khoroshevskyi
khoroshevskyi merged commit 3e2133f into modernize_1 Feb 26, 2026
10 checks passed
@khoroshevskyi
khoroshevskyi deleted the modernize_p4 branch July 31, 2026 21:35
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.

2 participants