chore: implement __repr__ method for FileId class (#1628)#1770
chore: implement __repr__ method for FileId class (#1628)#1770exploreriii merged 5 commits intohiero-ledger:mainfrom
Conversation
Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
WalkthroughAdds a custom repr to FileId returning constructor-style strings without checksum (e.g., "FileId(shard=0, realm=0, file=150)"), includes unit tests for the new representation, and updates the changelog. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Tip We've launched Issue Planner and it is currently in beta. Please try it out and share your feedback on Discord! 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.
Pull request overview
Implements a custom __repr__ for FileId to provide a cleaner, constructor-style debug representation (and records the change in the changelog), addressing the debugging ergonomics requested in #1628.
Changes:
- Added
FileId.__repr__()returningFileId(shard=..., realm=..., file=...). - Added unit tests asserting the new
repr(FileId(...))output. - Updated
CHANGELOG.mdunder Added to document the feature.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/hiero_sdk_python/file/file_id.py |
Adds __repr__() for clearer debugging output. |
tests/unit/file_id_test.py |
Adds assertions for FileId’s new __repr__() output. |
CHANGELOG.md |
Documents the new FileId.__repr__ feature in Unreleased/Added. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. Quick Fix for CHANGELOG.md ConflictsIf your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:
For all other merge conflicts, please read: Thank you for contributing! |
Signed-off-by: Subhra Sameer Dash <170787407+Subhrasameerdash@users.noreply.github.com>
aceppaluni
left a comment
There was a problem hiding this comment.
@Subhrasameerdash This is looking great, thank you!
Once the AI/coderabbit suggestions are implemented will take another look.
Thank you and happy contributing!
exploreriii
left a comment
There was a problem hiding this comment.
Thanks! I think this is good to go once the merge conflict is solved.
@aceppaluni the code rabbit feedback in this case is proposing something going against the issue description, so we can safely ignore it in this case
Signed-off-by: Subhra Sameer Dash <170787407+Subhrasameerdash@users.noreply.github.com>
|
Hello, this is the OfficeHourBot. This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC). This session provides an opportunity to ask questions regarding this Pull Request. Details:
Disclaimer: This is an automated reminder. Please verify the schedule here for any changes. From, |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1770 +/- ##
=======================================
Coverage 93.29% 93.29%
=======================================
Files 141 141
Lines 9116 9118 +2
=======================================
+ Hits 8505 8507 +2
Misses 611 611 🚀 New features to boost your workflow:
|
requested changes do not apply in this case
|
Thank you @Subhrasameerdash ! |
|
🎉 Nice work completing a Beginner issue! Thank you for your contribution to the Hiero Python SDK! We're excited to have you as part of our community. Here are some Good First Issue issues at a similar level you might be interested in working on next:
🌟 Stay connected with the project:
We look forward to seeing more contributions from you! If you have any questions, feel free to ask in our Discord community. From the Hiero Python SDK Team 🚀 |
|
Thank you @exploreriii for being patient with me. This pr was challenging and I enjoyed it a lot |
|
That's really nice to hear. |
…hiero-ledger#1770) Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in> Signed-off-by: Subhra Sameer Dash <170787407+Subhrasameerdash@users.noreply.github.com>
Description:
Summary
What Changed
Added repr() method to FileId class in file_id.py
Returns format: FileId(shard=X, realm=Y, file=Z)
Excludes the checksum field to keep output clean
Provides a constructor-style representation for better debugging experience
Added unit tests in file_id_test.py
test_repr_representation() - tests default values
test_repr_representation_custom_values() - tests custom values
Updated CHANGELOG.md with the new feature entry in the Added section
Related issue(s):
Fixes #1628
Notes for reviewer:
Checklist