Skip to content

Commit

Permalink
Canonicalize key names in config.rename (#4903)
Browse files Browse the repository at this point in the history
Fixes #4902
  • Loading branch information
bolliger32 authored and mrocklin committed Jun 8, 2019
1 parent 3036318 commit c8a69d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dask/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def rename(aliases, config=config):
new[n] = value

for k in old:
del config[k] # TODO: support nested keys
del config[canonical_name(k, config)] # TODO: support nested keys

set(new, config=config)

Expand Down
2 changes: 1 addition & 1 deletion dask/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_ensure_file_defaults_to_DASK_CONFIG_directory(tmpdir):


def test_rename():
aliases = {'foo-bar': 'foo.bar'}
aliases = {'foo_bar': 'foo.bar'}
config = {'foo-bar': 123}
rename(aliases, config=config)
assert config == {'foo': {'bar': 123}}
Expand Down

0 comments on commit c8a69d0

Please sign in to comment.