Don't crash right away if op is uninitialized.#12615
Conversation
📝 WalkthroughWalkthroughThe change adds defensive error handling to the 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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.
🧹 Nitpick comments (1)
comfy/ops.py (1)
831-831: Redundant"Warning:"prefix in the log message.
logging.warning(...)already marks the record asWARNINGlevel — prepending the literal string"Warning:"is noise in both the log output and log aggregators.🔧 Suggested fix
- logging.warning("Warning: state dict on uninitialized op {}".format(prefix)) + logging.warning("state dict on uninitialized op {}".format(prefix))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@comfy/ops.py` at line 831, Remove the redundant literal "Warning:" prefix from the logging call and log the message directly; locate the logging.warning call that currently builds "Warning: state dict on uninitialized op {}".format(prefix) and change it to log "state dict on uninitialized op" with the prefix supplied as a parameter (use logging.warning with format-style args or an f-string) so the record level isn't duplicated and the message stays structured and concise.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@comfy/ops.py`:
- Line 831: Remove the redundant literal "Warning:" prefix from the logging call
and log the message directly; locate the logging.warning call that currently
builds "Warning: state dict on uninitialized op {}".format(prefix) and change it
to log "state dict on uninitialized op" with the prefix supplied as a parameter
(use logging.warning with format-style args or an f-string) so the record level
isn't duplicated and the message stays structured and concise.
No description provided.