Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use skip_table_creation when using Optuna v3 or later #320

Merged
merged 2 commits into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions optuna_dashboard/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions optuna_dashboard/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from . import __version__
from ._app import create_app
from ._app import get_storage
from ._sql_profiler import register_profiler_view


Expand Down Expand Up @@ -97,11 +98,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):
Expand Down