Update README.md to use f-string examples - #2318
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Updates the project’s main README examples to use modern Python f-strings, aligning the documentation with current Python style and the repository’s supported Python versions.
Changes:
- Converted producer delivery-report example prints from
.format()to f-strings. - Converted consumer error/received-message prints from
.format()to f-strings. - Converted AdminClient topic creation success/failure prints from
.format()to f-strings.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ankith L (Ankith-Confluent)
left a comment
There was a problem hiding this comment.
Hi Allen (@allen505)
Thanks for the PR, just one minor nit.
| Triggered by poll() or flush().""" | ||
| if err is not None: | ||
| print('Message delivery failed: {}'.format(err)) | ||
| print(f'Message delivery failed: {err}') |
There was a problem hiding this comment.
nit, the consumer and AdminClient examples below use f"..."
Since you're already touching these lines, mind matching?
There was a problem hiding this comment.
Did you mean like, matching the error message? Coz both of them use the update f-strings now
There was a problem hiding this comment.
I meant the quote character, not the f-string. Could you change f'...' to f"..." on both lines to match the consumer/AdminClient examples (and black's convention).
Fixes #2250
What
Updated the README.md to use the newer f-string examples instead of using the
.format()methodChecklist
References
JIRA: NA
Fixes #2250
Test & Review
Checked the README rendered on Github
Open questions / Follow-ups