MCPcopy Create free account
hub / github.com/dask/dask / update_defaults

Function update_defaults

dask/config.py:645–659  ·  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

643
644
645def update_defaults(
646 new: Mapping, config: dict = config, defaults: list[Mapping] = defaults
647) -> None:
648 """Add a new set of defaults to the configuration
649
650 It does two things:
651
652 1. Add the defaults to a global collection to be used by refresh later
653 2. Updates the global config with the new configuration.
654 Old values are prioritized over new ones, unless the current value
655 is the old default, in which case it's updated to the new default.
656 """
657 current_defaults = merge(*defaults)
658 defaults.append(new)
659 update(config, new, priority="new-defaults", defaults=current_defaults)
660
661
662def 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