-
Notifications
You must be signed in to change notification settings - Fork 1
Bump json to mashumaro #23
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
Conversation
Warning Rate limit exceeded@CoMPaTech has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 24 seconds before requesting another review. ⌛ 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. 📒 Files selected for processing (2)
""" WalkthroughA new data model for AirOS device data was introduced using Python dataclasses and enums in a new file. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AirOS
participant AirOSData
User->>AirOS: status(return_json=False)
AirOS->>AirOS: Fetch device status JSON
AirOS->>AirOSData: AirOSData.from_dict(json)
alt Deserialization fails
AirOS->>User: Raise KeyDataMissingError
else Success
AirOS->>User: Return AirOSData object
end
Estimated code review effort4 (~90 minutes) Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 7
🧹 Nitpick comments (3)
pyproject.toml (1)
7-7
: Remember to tag & publish 0.1.2Version bump looks fine; ensure the changelog and release workflow are updated accordingly.
README.md (1)
25-25
: Clarify return type before attribute access
result
may still be a rawdict
if the caller doesn’t passtyped=True
(or similar flag) tostatus()
. Accessingresult.wireless.mode
would raiseAttributeError
.Add a brief note or guard in the snippet:
result = await device.status(typed=True) print(result.wireless.mode)This avoids confusion for copy-paste users.
airos/airos8data.py (1)
377-382
: Overly broad union types reduce type safetyThe union types for
provmode
andntpclient
are extremely broad, accepting almost any type. This defeats the purpose of type checking.Consider narrowing the union types to be more specific:
- provmode: ( - ProvisioningMode | str | dict[str, Any] | list[Any] | Any - ) # If it can be populated, define its fields - ntpclient: ( - NtpClient | str | dict[str, Any] | list[Any] | Any - ) # If it can be populated, define its fields + provmode: ProvisioningMode | dict[str, Any] + ntpclient: NtpClient | dict[str, Any]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
README.md
(1 hunks)airos/airos8.py
(3 hunks)airos/airos8data.py
(1 hunks)fixtures/ap-ptp.json
(1 hunks)fixtures/sta-ptp.json
(1 hunks)pyproject.toml
(2 hunks)requirements.txt
(1 hunks)tests/test_stations.py
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Run pytest using Python 3.13
🔇 Additional comments (2)
requirements.txt (1)
2-2
: LGTM – new dependency added
mashumaro==3.16
is correctly pinned. No issues spotted here.pyproject.toml (1)
25-25
: Pinning style differs fromrequirements.txt
requirements.txt
pinsmashumaro==3.16
, whereaspyproject.toml
uses an unpinned"mashumaro"
entry. To avoid accidental breaking upgrades in downstream builds, mirror the exact version spec here too:- "mashumaro", + "mashumaro==3.16",
Summary by CodeRabbit
New Features
Documentation
Chores
Style
Tests