fix(mavvrik): fix mypy type errors in __init__.py

- Change type: ignore[union-attr] → type: ignore[attr-defined] for
  scheduler.add_job() call
- Fix float+Decimal operand error by casting each polars sum()
  separately with int()

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Praveen Ghuge 2026-05-13 22:07:20 +05:30
parent 82ef2acbbf
commit 6b317c5a81

View file

@ -62,7 +62,7 @@ def _schedule_job(
)
uploader = Uploader(client=client)
orchestrator = Orchestrator(client=client, uploader=uploader)
scheduler.add_job( # type: ignore[union-attr]
scheduler.add_job( # type: ignore[attr-defined]
orchestrator.run,
"interval",
minutes=MAVVRIK_EXPORT_INTERVAL_MINUTES,
@ -411,7 +411,7 @@ class Service:
total_cost = float(df["spend"].sum() or 0.0) if "spend" in df.columns else 0.0
total_tokens = (
int((df["prompt_tokens"].sum() or 0) + (df["completion_tokens"].sum() or 0))
int(df["prompt_tokens"].sum() or 0) + int(df["completion_tokens"].sum() or 0)
if "prompt_tokens" in df.columns and "completion_tokens" in df.columns
else 0
)