MCPcopy
hub / github.com/dask/dask / update_defaults

Function update_defaults

dask/config.py:683–697  ·  view source on GitHub ↗

Add a new set of defaults to the configuration It does two things: 1. Add the defaults to a global collection to be used by refresh later 2. Updates the global config with the new configuration. Old values are prioritized over new ones, unless the current value is the

(
    new: Mapping, config: dict = config, defaults: list[Mapping] = defaults
)

Source from the content-addressed store, hash-verified

681
682
683def update_defaults(
684 new: Mapping, config: dict = config, defaults: list[Mapping] = defaults
685) -> None:
686 """Add a new set of defaults to the configuration
687
688 It does two things:
689
690 1. Add the defaults to a global collection to be used by refresh later
691 2. Updates the global config with the new configuration.
692 Old values are prioritized over new ones, unless the current value
693 is the old default, in which case it's updated to the new default.
694 """
695 current_defaults = merge(*defaults)
696 defaults.append(new)
697 update(config, new, priority="new-defaults", defaults=current_defaults)
698
699
700def expand_environment_variables(config: Any) -> Any:

Callers 3

test_update_defaultsFunction · 0.90
test_refreshFunction · 0.90
_initializeFunction · 0.85

Calls 2

updateFunction · 0.85
mergeFunction · 0.70

Tested by 2

test_update_defaultsFunction · 0.72
test_refreshFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…