Skip to content

[core] Fix publisher_id type mismatch in GCS pubsub#61518

Open
kaori-seasons wants to merge 1 commit intoray-project:masterfrom
kaori-seasons:bug-type-error
Open

[core] Fix publisher_id type mismatch in GCS pubsub#61518
kaori-seasons wants to merge 1 commit intoray-project:masterfrom
kaori-seasons:bug-type-error

Conversation

@kaori-seasons
Copy link

  • Fix comparison of bytes vs str: self._publisher_id is initialized as b"" (bytes) but was compared against "" (str). In Python 3, b"" != "" is always True, causing spurious debug logs on first connection.
  • Add missing space between f-string fragments in debug log.
  • Fix grammar: "only happens" -> "only happen".

Thank you for contributing to Ray! 🚀
Please review the Ray Contribution Guide before opening a pull request.

⚠️ Remove these instructions before submitting your PR.

💡 Tip: Mark as draft if you want early feedback, or ready for review when it's complete.

Description

Type Comparing Error

Related issues

Related to issue-61517

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

@kaori-seasons kaori-seasons requested a review from a team as a code owner March 5, 2026 07:59
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively resolves a type mismatch issue where a bytes object (self._publisher_id) was incorrectly compared with a string literal. This fix prevents spurious debug logs and ensures correct comparison logic. Additionally, minor improvements to log message formatting and grammar have been applied, enhancing code clarity and maintainability.

@Yicheng-Lu-llll Yicheng-Lu-llll added core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests labels Mar 5, 2026
Copy link
Member

@Yicheng-Lu-llll Yicheng-Lu-llll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

- Fix comparison of bytes vs str: self._publisher_id is initialized
  as b"" (bytes) but was compared against "" (str). In Python 3,
  b"" != "" is always True, causing spurious debug logs on first
  connection.
- Add missing space between f-string fragments in debug log.
- Fix grammar: "only happens" -> "only happen".

Signed-off-by: kaori-seasons <yuluoxinsheng@gmail.com>
Signed-off-by: hageshiame <2664504212@qq.om>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants