Skip to content

Commit

Permalink
assert -> valueError
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Chigarev <[email protected]>
  • Loading branch information
dchigarev committed Apr 3, 2024
1 parent 1c43afb commit d687be2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modin/config/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,12 @@ def update(
>>> MyParameter2.get()
True
"""
if value is None:
assert isinstance(config, dict)
else:
if value is not None:
config = {cast(Parameter, config): value}
elif not isinstance(config, dict):
raise ValueError(
f"Expected to get a dictionary as a 'config' when 'value is None', got {type(config)}"
)

old_values = {}
for cfg, val in config.items():
Expand Down

0 comments on commit d687be2

Please sign in to comment.