Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis PR introduces mypy static type checking to the CI workflow and refines type hints throughout the codebase. Changes include narrowing parameter types, adding cast calls for type safety, and clarifying return types for multiple functions, without altering runtime behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@xarray_plotly/config.py`:
- Line 11: The failing TC006 rule is caused by unquoted type expressions passed
to cast() in xarray_plotly/config.py; locate the cast(...) calls that currently
use bool, str, and dict[str, tuple[str, ...]] and replace their type arguments
with string-literal types (e.g., cast("bool", ...), cast("str", ...),
cast("dict[str, tuple[str, ...]]", ...)) so the type expressions are quoted;
ensure you update each cast invocation (search for cast usages around the config
parsing/assignment logic) to use the quoted form.
Summary
Adds mypy type checking to CI and fixes all type errors to pass strict mode.
Changes
CI (
ci.yml):Type fixes:
figures.py: Added proper type parameters forIterator,list[go.Frame]return types, anddict[str, Any]for kwargsconfig.py: Usedcast()with quoted type strings for restoring optionscommon.py: Added type parameterdict[str, object]for attrs argumentplotting.py: Changednp.ndarraytonpt.ArrayLikefor array-like input__init__.py: Added# type: ignore[no-untyped-call]for xarray's untyped accessor decoratorsTest plan
mypy xarray_plotlypasses with no errorsruff check .passespytestpasses (121 tests)