Hi @bulky-afternoon-92433 Sir I'm working on Issue #4 (Type hints for backend code). Here's my analysis and proposed plan:
I've audited the entire metaflow-service codebase and found that type hints are missing across
3 major layers: the core DB classes (_AsyncPostgresDB, AsyncPostgresTable + 6 subclasses), the Cache subsystem, and all API handlers across all 3 services.
My approach: I'd like to do this
bottom-up in ~6 incremental PRs - starting with model classes and DB utilities (smallest, safest), then core DB layer, then UI backend tables, then cache, then refiners, and finally API handlers. Each PR would be self-contained and reviewable independently.
Key decisions I'd like your input on:
Should I convert DBResponse/DBPagination namedtuples into typing.NamedTuple with typed fields?
Should I add a
mypy
config and
py.typed
marker so types can be verified in CI?
What's the minimum Python version I should target for typing syntax?
1. Do you prefer Dict[str, Any] or should I create `TypedDict`s for the serialize() returns?
I can start with PR 1 (models.py + db_utils.py + utils/*init*.py) as a proof of concept - happy to adjust the approach based on your feedback....