-
Notifications
You must be signed in to change notification settings - Fork 6
Fix unsupported operator on MainSchemaTypes #721
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
WalkthroughThis pull request modifies the Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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 |
Deploying infrahub-sdk-python with
|
| Latest commit: |
9e2c560
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d2dcb767.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://pog-fix-unsupported-operator.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## infrahub-develop #721 +/- ##
====================================================
+ Coverage 76.28% 76.30% +0.02%
====================================================
Files 114 114
Lines 9830 9830
Branches 1508 1508
====================================================
+ Hits 7499 7501 +2
+ Misses 1837 1836 -1
+ Partials 494 493 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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: 0
🧹 Nitpick comments (1)
infrahub_sdk/node/node.py (1)
207-214: Consider applying the same safer pattern to similar checks.For consistency with the fix in
get_all_kinds(), you might consider updating the otherinherit_fromchecks to use the samegetattrpattern:# Line 207 inherit_from = getattr(self._schema, "inherit_from", []) return self.get_kind() == builtin_ipprefix_kind or builtin_ipprefix_kind in inherit_from # Line 211 inherit_from = getattr(self._schema, "inherit_from", []) return self.get_kind() == builtin_ipaddress_kind or builtin_ipaddress_kind in inherit_from # Line 214 inherit_from = getattr(self._schema, "inherit_from", []) return "CoreResourcePool" in inherit_fromThis would eliminate the remaining
type: ignore[union-attr]comments and make the attribute access pattern consistent across the class.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
infrahub_sdk/node/node.pypyproject.toml
💤 Files with no reviewable changes (1)
- pyproject.toml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
**/*.py: Use type hints on all function signatures
Never mix async/sync inappropriately
Never bypass type checking without justification
Files:
infrahub_sdk/node/node.py
infrahub_sdk/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Follow async/sync dual pattern for new features in the Python SDK
Files:
infrahub_sdk/node/node.py
🧬 Code graph analysis (1)
infrahub_sdk/node/node.py (1)
infrahub_sdk/node/related_node.py (1)
kind(132-135)
⏰ 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: Cloudflare Pages
🔇 Additional comments (1)
infrahub_sdk/node/node.py (1)
200-203: LGTM! Safer attribute access with walrus operator.The implementation correctly uses
getattrwith a default value and the walrus operator to safely handle cases whereinherit_frommight be missing,None, or an empty list. This eliminates the type-checking issue that required ignoring theunsupported-operatorrule.
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.