Skip to content

fix(metadata-expert): pass report_spec through the four find methods exec_report_spec uses - #543

Merged
dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:claude/fix-metadata-expert-report-spec-kwarg
Nov 7, 2026
Merged

dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:claude/fix-metadata-expert-report-spec-kwarg

Conversation

@dwolfson

@dwolfson dwolfson commented Nov 7, 2026

Copy link
Copy Markdown
Member

Fixes exec_report_spec for every report spec backed by MetadataExpert find methods. Before this fix they all failed with TypeError: ... got multiple values for keyword argument 'report_spec'.

Cause. In pyegeria/omvs/metadata_expert.py, four find methods passed report_spec=None to _async_find_request and also forwarded **kwargs. exec_report_spec always supplies report_spec, so the argument arrived twice. The four methods:

  • find_metadata_elements_with_string
  • find_elements_for_anchor
  • find_elements_in_anchor_domain
  • find_elements_in_anchor_scope

Fix. Each of the four now takes report_spec as a named parameter and passes it on. As a result, the spec's own columns are now also used for non-JSON output; before, they were dropped.

Test. tests/micro-tests/test_metadata_expert_report_spec_kwarg.py uses the real MetadataExpert class with only _async_make_request faked. It:

  • runs all 40 registered specs that use find_metadata_elements_with_string through exec_report_spec, Report-DrE-Basic among them;
  • calls each of the four methods directly, checking that report_spec stays out of the request body.

Without the fix it fails with the exact TypeError; with it, all 45 cases pass. The full micro-test suite on 3.13 gives 1858 passed and 1 skipped.

Found during the #541 live test. The test scans the spec registry, so it will also cover Dashboard-DrE-Basic and Dashboards once #541 merges.

🤖 Generated with Claude Code

The four MetadataExpert find methods (find_metadata_elements_with_string,
find_elements_for_anchor, find_elements_in_anchor_domain,
find_elements_in_anchor_scope) hardcoded report_spec=None in their
_async_find_request call while also forwarding **kwargs. exec_report_spec
always adds report_spec to the call, so every report spec backed by one of
them (40 registered specs, e.g. Report-DrE-Basic) failed with
"got multiple values for keyword argument 'report_spec'".

Each method now takes report_spec explicitly and passes it on, so the
spec's own columns are used for non-JSON output.

The new micro-test runs every registered spec naming
find_metadata_elements_with_string through exec_report_spec, plus each of
the four sync methods directly, against the real client with only
_async_make_request faked.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit eb8ce01 into odpi:main Nov 7, 2026
6 checks passed
dwolfson added a commit that referenced this pull request Nov 7, 2026
Ships #537 (five link methods sent a properties class Egeria lacks),
#538 (population= is the count keyword; scope= deprecated), #539
(declarations for every registered routine), #540 and #541 (client
support and Dr.Egeria commands for Egeria 6.3 report specs,
measurements and dashboards), #542 (built-in declaration tests scoped to
pyegeria's own routines) and #543 (report_spec passed through the
MetadataExpert find methods).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson deleted the claude/fix-metadata-expert-report-spec-kwarg branch November 20, 2026 19:14
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.

1 participant