Skip to content

Add return type hints to dashboard/app.py cache helpers #29

Description

@AshayK003

Title: Add return type hints to dashboard/app.py cache helpers

Body:

Problem

Three cached helper functions in dashboard/app.py have docstrings but no return type annotations:

  • get_connection() — returns sqlite3.Connection
  • _get_cached_portfolio() — returns list[dict]
  • _get_cached_filings(bse_code: str) — returns list[dict]

Solution

Add return type hints to all three functions.

@st.cache_resource
def get_connection() -> sqlite3.Connection:
    ...

@st.cache_data(ttl=30)
def _get_cached_portfolio() -> list[dict]:
    ...

@st.cache_data(ttl=30)
def _get_cached_filings(bse_code: str) -> list[dict]:
    ...

Acceptance Criteria

  • get_connection() has return type -> sqlite3.Connection
  • _get_cached_portfolio() has return type -> list[dict]
  • _get_cached_filings(bse_code: str) has return type -> list[dict]
  • pytest tests/ -v passes with no new errors

Difficulty

Easy — 3 type annotations, 1 file

Size

XS — ~3 lines changed

Files Affected

dashboard/app.py

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions