Skip to content

Field reducer: blacklist also removes sub-fields of extra keys - #2733

Open
10k11 wants to merge 1 commit into
certtools:developfrom
10k11:field-reducer-blacklist-extra-subfields
Open

10k11 wants to merge 1 commit into
certtools:developfrom
10k11:field-reducer-blacklist-extra-subfields

Conversation

@10k11

@10k11 10k11 commented Nov 5, 2026 •

Copy link
Copy Markdown

Fixes #2558

The extra field is stored as a flattened dictionary, so a blacklist key like extra.source did not match extra.source.naics and removed nothing.

In blacklist mode, keys in the extra namespace (extra or extra.*) now also remove all fields below them. Matching is by key. prefix, so extra.sourcefoo is kept. I limited this to extra because other fields have a fixed schema and the issue only asks for extra; happy to adjust if you want broader behaviour.

  • Tests: added two cases to the field reducer tests; the field reducer tests pass on Linux (Python 3.12).
  • Docs and CHANGELOG updated.

The extra field is stored as a flattened dictionary, so a blacklist key
like "extra.source" did not match "extra.source.naics" and removed
nothing. Keys in the extra namespace now also remove all fields below
them (matched by "key." prefix, so "extra.sourcefoo" is kept).

The behaviour is limited to the extra namespace and to blacklist mode
because other fields have a fixed schema and the issue only asks for
extra.

Fixes certtools#2558
@10k11
10k11 force-pushed the field-reducer-blacklist-extra-subfields branch from 2f5f297 to ce2d0db Compare November 5, 2026 06:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Field Reducer: Support to remove sub-fields in extra

1 participant