-
Notifications
You must be signed in to change notification settings - Fork 70
LCORE-890: fixed all pyright issues found in quota limiters tests #1075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LCORE-890: fixed all pyright issues found in quota limiters tests #1075
Conversation
WalkthroughTests in the quota module were updated to match an expanded PostgreSQL configuration: password fields now use Changes
Sequence Diagram(s)(Skipped — changes are test/type updates without new or altered multi-component control flow.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
cc7b70a to
1ceab70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@tests/unit/quota/test_quota_limiter_factory.py`:
- Around line 6-9: The import order is wrong: third‑party imports must come
before first‑party ones. Move the pydantic import (SecretStr from pydantic)
above the project import (constants) so that "from pydantic import SecretStr" is
grouped with other third‑party imports and "import constants" remains with
first‑party imports to satisfy pylint import ordering.
🧹 Nitpick comments (2)
tests/unit/quota/test_user_quota_limiter.py (1)
16-32: Prefer constructor args to avoid the pyright ignore.
ConstructingQuotaHandlersConfigurationwith the fields removes the suppression and keeps the test typed.♻️ Proposed refactor
- configuration = QuotaHandlersConfiguration() # pyright: ignore[reportCallIssue] - configuration.sqlite = SQLiteDatabaseConfiguration( - db_path=":memory:", - ) - configuration.limiters = [ - QuotaLimiterConfiguration( - type="user_limiter", - name=name, - initial_quota=quota_limit, - quota_increase=1, - period="5 days", - ), - ] + configuration = QuotaHandlersConfiguration( + sqlite=SQLiteDatabaseConfiguration(db_path=":memory:"), + limiters=[ + QuotaLimiterConfiguration( + type="user_limiter", + name=name, + initial_quota=quota_limit, + quota_increase=1, + period="5 days", + ), + ], + )tests/unit/quota/test_cluster_quota_limiter.py (1)
16-32: Prefer constructor args to avoid the pyright ignore.
Same rationale as the user limiter test: build the config with fields to keep typing intact.♻️ Proposed refactor
- configuration = QuotaHandlersConfiguration() # pyright: ignore[reportCallIssue] - configuration.sqlite = SQLiteDatabaseConfiguration( - db_path=":memory:", - ) - configuration.limiters = [ - QuotaLimiterConfiguration( - type="cluster_limiter", - name=name, - initial_quota=quota_limit, - quota_increase=1, - period="5 days", - ), - ] + configuration = QuotaHandlersConfiguration( + sqlite=SQLiteDatabaseConfiguration(db_path=":memory:"), + limiters=[ + QuotaLimiterConfiguration( + type="cluster_limiter", + name=name, + initial_quota=quota_limit, + quota_increase=1, + period="5 days", + ), + ], + )
Description
LCORE-890: fixed all pyright issues found in quota limiters tests
Type of change
Tools used to create PR
Related Tickets & Documents
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.