Skip to content

Conversation

SAKURA-CAT
Copy link
Member

Removed the import of LocalRunCallback from the callbacker module and updated dynamic imports in utils.py to only include necessary callbacks.

修复如果 dashboard 没安装时即使没有使用本地模式也报错的问题

Removed the import of LocalRunCallback from the callbacker module and updated dynamic imports in utils.py to only include necessary callbacks.
@SAKURA-CAT SAKURA-CAT self-assigned this Jul 7, 2025
@SAKURA-CAT SAKURA-CAT added the 💪 enhancement New feature or request label Jul 7, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes import errors when the dashboard package isn’t installed by removing the LocalRunCallback export and only dynamically importing the needed callbacks in utils.py.

  • Removed wildcard and unused callback imports in swanlab/data/utils.py, replacing them with explicit in-function imports.
  • Updated swanlab/data/callbacker/__init__.py to no longer auto-export LocalRunCallback and reflect that change in the header.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
swanlab/data/utils.py Drop from ...callbacker import *; add explicit imports of only DisabledCallback, CloudPyCallback, and OfflineCallback within _create_operator.
swanlab/data/callbacker/init.py Remove LocalRunCallback export; update module doc to note it’s not auto-exported.
Comments suppressed due to low confidence (2)

swanlab/data/utils.py:165

  • The docstring mentions CloudRunCallback, but the code now imports and uses CloudPyCallback. Update the return description to match CloudPyCallback.
    :return: SwanLabRunOperator, CloudRunCallback

swanlab/data/callbacker/init.py:6

  • [nitpick] Since LocalRunCallback is no longer auto-exported, consider adding a brief note on how to import it manually if users still need local callbacks (e.g., from swanlab.data.callbacker.local import LocalRunCallback).
1. local: 本地模式回调器,此回调不自动导出

@SAKURA-CAT SAKURA-CAT merged commit 7c4b00d into main Jul 7, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the fix/dashboard-import branch July 7, 2025 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants