[PR #21517] Fix minor comment missing #29688

Closed
opened 2026-02-21 20:46:03 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/21517

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

This pull request resolves issues related to redundant parameters in logging and missing logs. Specifically:

  • Removed unnecessary parameters from error messages in the run_free_node function.
  • Added a warning log in _apply_new_embedding_settings to handle cases where embedding model initialization fails.

Key Changes:

  1. run_free_node function:

    • Removed workflow_id from the log message.

    Before:

    logger.exception(
        "error while running node_instance, workflow_id=%s, node_id=%s, type=%s, version=%s",
        node_instance.workflow_id,
        node_instance.id,
        node_instance.node_type,
        node_instance.version(),
    )
    

    After:

    logger.exception(
        "error while running node_instance, node_id=%s, type=%s, version=%s",
        node_instance.id,
        node_instance.node_type,
        node_instance.version(),
    )
    
  2. _apply_new_embedding_settings function:

    • Added a warning log for cases where the embedding model initialization fails.

    New Log:

    logging.warning(
        f"Failed to initialize embedding model {data['embedding_model_provider']}/{data['embedding_model']}, "
        f"preserving existing settings"
    )
    

Screenshots

Before After
N/A N/A

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods.

**Original Pull Request:** https://github.com/langgenius/dify/pull/21517 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 2. Ensure there is an associated issue and you have been assigned to it > 3. Use the correct syntax to link this PR: `Fixes #<issue number>`. --- ## Summary This pull request resolves issues related to redundant parameters in logging and missing logs. Specifically: - Removed unnecessary parameters from error messages in the `run_free_node` function. - Added a warning log in `_apply_new_embedding_settings` to handle cases where embedding model initialization fails. ### Key Changes: 1. **`run_free_node` function**: - Removed `workflow_id` from the log message. **Before:** ```python logger.exception( "error while running node_instance, workflow_id=%s, node_id=%s, type=%s, version=%s", node_instance.workflow_id, node_instance.id, node_instance.node_type, node_instance.version(), ) ``` **After:** ```python logger.exception( "error while running node_instance, node_id=%s, type=%s, version=%s", node_instance.id, node_instance.node_type, node_instance.version(), ) ``` 2. **`_apply_new_embedding_settings` function**: - Added a warning log for cases where the embedding model initialization fails. **New Log:** ```python logging.warning( f"Failed to initialize embedding model {data['embedding_model_provider']}/{data['embedding_model']}, " f"preserving existing settings" ) ``` --- ## Screenshots | Before | After | |--------|-------| | N/A | N/A | --- ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods. ---
yindo added the pull-request label 2026-02-21 20:46:03 -05:00
yindo closed this issue 2026-02-21 20:46:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#29688