One function

get_history in dynaconf/dynaconf

The author described this change as fix: Fix get_history ignoring its history_limit argument (#1424). It counts as a record because the check below fails on the code as it stood at c3e65779f and passes on 1654b0d0d, with nothing else changed between the two runs.

Fix saved2026-08-01
Sharing licenceMIT · LICENSE
Change size+3 0

What the code was meant to do, written into the code itself as a docstring

Gets data from `settings.loaded_by_loaders` in order of loading with optional filtering options. Returns a list of dict in new-first order, where the dict contains the data and it's source metadata. :param obj: Setting object which contain the data :param key: Key path to desired key. Use all if not provided :param filter_callable: Takes SourceMetadata and returns a boolean :param include_internal: If True, include internal loaders (e.g. defaults). This has effect only if key is not provided. history_limit: limits how many entries are shown Example:

The change

8181 if key and not result:
8282 raise KeyNotFoundError(f"The requested key was not found: {key!r}")
8383
84+ if history_limit:
85+ result = result[:history_limit]
86+
8487 return result

The check that tells the two apart

failpass·tests/test_inspect.py::test_get_history_history_limit

Check file tests/test_inspect.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itc3e65779f5fd7082130cb11391712b0b7f1ce85b
Broken version dated2026-07-31
Moduledynaconf.utils.inspect
Units changedget_history
Fingerprintf40668641a1f27f0
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in dynaconf/dynaconf