add str method to JinjaTemplateError#795
Conversation
WalkthroughA 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
infrahub_sdk/template/exceptions.py (1)
11-16:⚠️ Potential issue | 🟡 MinorAdd class-level type annotation for
messageto fix the pipeline failure.The CI pipeline reports a type error because the type checker cannot infer that
self.messageis alwaysstr. Adding a class-level type annotation will resolve this.🔧 Proposed fix
class JinjaTemplateError(Error): + message: str + def __init__(self, message: str) -> None: self.message = message def __str__(self) -> str: return self.message
Deploying infrahub-sdk-python with
|
| Latest commit: |
dd1103e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://57055048.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://ajtm-0203206-str-jinja-err.infrahub-sdk-python.pages.dev |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## stable #795 +/- ##
==========================================
- Coverage 80.36% 80.35% -0.01%
==========================================
Files 115 115
Lines 9865 9867 +2
Branches 1504 1504
==========================================
+ Hits 7928 7929 +1
- Misses 1415 1416 +1
Partials 522 522
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
add
__str__to Jinja templates so that they can be correctly displayed when passed intostr()one of these errors was raised during a migration and passed into
str, which resulted in an empty string and made troubleshooting harder than it needed to beSummary by CodeRabbit