mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Use skip_table_creation when using Optuna v3 or later
This commit is contained in:
@@ -406,6 +406,8 @@ def get_storage(storage: Union[str, BaseStorage]) -> BaseStorage:
|
||||
raise ValueError(
|
||||
"RedisStorage is unsupported from Optuna v3.1 or Optuna Dashboard v0.8.0"
|
||||
)
|
||||
elif version.parse(optuna_ver) >= version.Version("v3.0.0"):
|
||||
return RDBStorage(storage, skip_compatibility_check=True, skip_table_creation=True)
|
||||
else:
|
||||
return RDBStorage(storage, skip_compatibility_check=True)
|
||||
return storage
|
||||
|
||||
@@ -11,7 +11,7 @@ from optuna.storages import BaseStorage
|
||||
from optuna.storages import RDBStorage
|
||||
|
||||
from . import __version__
|
||||
from ._app import create_app
|
||||
from ._app import create_app, get_storage
|
||||
from ._sql_profiler import register_profiler_view
|
||||
|
||||
|
||||
@@ -97,11 +97,7 @@ def main() -> None:
|
||||
args = parser.parse_args()
|
||||
|
||||
storage: BaseStorage
|
||||
if args.storage.startswith("redis"):
|
||||
raise ValueError("RedisStorage is unsupported from Optuna v3.1 or Optuna Dashboard v0.8.0")
|
||||
else:
|
||||
storage = RDBStorage(args.storage, skip_compatibility_check=True)
|
||||
|
||||
storage = get_storage(args.storage)
|
||||
app = create_app(storage, debug=DEBUG)
|
||||
|
||||
if DEBUG and isinstance(storage, RDBStorage):
|
||||
|
||||
Reference in New Issue
Block a user