diff --git a/python/ray/autoscaler/autoscaler.py b/python/ray/autoscaler/autoscaler.py index e97e56477..fb1c6389b 100644 --- a/python/ray/autoscaler/autoscaler.py +++ b/python/ray/autoscaler/autoscaler.py @@ -503,14 +503,16 @@ def check_required(config, schema): def check_extraneous(config, schema): """Make sure all items of config are in schema""" if type(config) is not dict: - raise ValueError("Config is not a dictionary") + raise ValueError("Config {} is not a dictionary".format(config)) for k in config: if k not in schema: raise ValueError( "Unexpected config key `{}` not in {}".format( k, list(schema.keys()))) v, kreq = schema[k] - if isinstance(v, type): + if v is None: + continue + elif isinstance(v, type): if not isinstance(config[k], v): raise ValueError( "Config key `{}` has wrong type {}, expected {}".format( @@ -522,7 +524,7 @@ def check_extraneous(config, schema): def validate_config(config, schema=CLUSTER_CONFIG_SCHEMA): """Required Dicts indicate that no extra fields can be introduced.""" if type(config) is not dict: - raise ValueError("Config is not a dictionary") + raise ValueError("Config {} is not a dictionary".format(config)) check_required(config, schema) check_extraneous(config, schema)