feat: Added key method of ListElement#257
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a way to query the (combined) MARS keys from a ListElement in the Python API, exposing them as a dict[str, str] via the pybind layer and the Python wrapper.
Changes:
- Expose
fdb5::ListElement::combinedKey()as a Python-accessiblekey()returning adict[str, str](viastd::map). - Add a
ListElement.keyproperty (and expanded docstrings) in the Python wrapper. - Add an integration test exercising the new
keyattribute across list levels.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
tests/pyfdb/integration/test_list.py |
Adds a parametrized integration test validating ListElement.key behavior per schema level. |
src/pyfdb_bindings/bindings.cc |
Adds a ListElement.key binding that returns the combined key as a Python dict. |
src/pyfdb/pyfdb_iterator.py |
Adds ListElement.key property + docstrings; also changes offset/length API shape/behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
946741e to
d334923
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #257 +/- ##
===========================================
- Coverage 71.22% 71.19% -0.03%
===========================================
Files 376 376
Lines 23762 23762
Branches 2478 2478
===========================================
- Hits 16924 16918 -6
- Misses 6838 6844 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d334923 to
4c6a4ac
Compare
danovaro
left a comment
There was a problem hiding this comment.
lgtm, only a small remark on the documentation
For a ListElement we are now able to query the keys. The keys of the ListElement are returned as a dict[str, str] and resemble the MARS keys on the individual level of the Schema.
4c6a4ac to
47ec20a
Compare
simondsmart
left a comment
There was a problem hiding this comment.
I would like to have a mechanism to extract either/both the 3 separated keys, correspnding to the the levels of the FDB, or the combined key. This only gives the combined key.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
def1c69 to
b841842
Compare
Description
For a ListElement we are now able to query the keys. The keys of the ListElement are returned as a dict[str, str] and resemble the MARS keys on the individual level of the Schema.
Contributor Declaration
By opening this pull request, I affirm the following:
🌈🌦️📖🚧 Documentation FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/dev-section/fdb/pull-requests/PR-257