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

Remove config key normalization #4742

Merged
merged 2 commits into from Apr 30, 2019

Conversation

Projects
None yet
4 participants
@jcrist
Copy link
Member

commented Apr 26, 2019

Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).

We now keep the user-facing functions (e.g. get, set, etc...)
agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.

Supersedes #4422.
Fixes #4366.

Remove config key normalization
Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).

We now keep the user-facing functions (e.g. ``get``, ``set``, etc...)
agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.

@jcrist jcrist referenced this pull request Apr 26, 2019

Closed

Switch `_` -> `-` config normalization to `-` -> `_` #4422

0 of 2 tasks complete
@mrocklin

This comment has been minimized.

Copy link
Member

commented Apr 26, 2019

cc @djhoese

djhoese added a commit to djhoese/donfig that referenced this pull request Apr 27, 2019

Remove config key normalization
Original changes by @jcrist, adapted for donfig.
See dask/dask#4742 for details.
@jcrist

This comment has been minimized.

Copy link
Member Author

commented Apr 29, 2019

Planning on merging tomorrow if no comment.

def canonical_name(k, config):
"""Return the canonical name for a key.
Handles user choose of '-' or '_' conventions by standardizing on whichever

This comment has been minimized.

Copy link
@quasiben

quasiben Apr 30, 2019

Member

small typo choose -> choice

This comment has been minimized.

Copy link
@jcrist

jcrist Apr 30, 2019

Author Member

Thanks, fixed.

@jcrist

This comment has been minimized.

Copy link
Member Author

commented Apr 30, 2019

Merging.

@jcrist jcrist merged commit cd1acd6 into dask:master Apr 30, 2019

@jcrist jcrist deleted the jcrist:config-canonicalization branch Apr 30, 2019

@djhoese

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2019

These changes have been ported to the donfig package and released as part of the 0.4.0 release (PyPI released, waiting on conda-forge).

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019

Remove config key normalization (dask#4742)
* Remove config key normalization

Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).

We now keep the user-facing functions (e.g. ``get``, ``set``, etc...)
agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.

* Type [skip ci]

Thomas-Z added a commit to Thomas-Z/dask that referenced this pull request May 17, 2019

Remove config key normalization (dask#4742)
* Remove config key normalization

Previously we'd normalize all key names in dask.config to hyphenated
names, replacing all underscores with hyphens. This causes problems with
keys that should be taken as literal values (e.g. environment variables
in an env key).

We now keep the user-facing functions (e.g. ``get``, ``set``, etc...)
agnostic to hyphen/underscores, but leave new keys unchanged. This has
the nice property that once a key is in the config it can be looked up
or changed by any provided name, but new keys (which may potentially be
data instead of config names) are unchanged.

* Type [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.