Skip to content

[c++] Support reading SOMAObject metadata in read and write mode#1584

Merged
nguyenv merged 1 commit intomainfrom
viviannguyen/access-metadata-any-mode
Aug 18, 2023
Merged

[c++] Support reading SOMAObject metadata in read and write mode#1584
nguyenv merged 1 commit intomainfrom
viviannguyen/access-metadata-any-mode

Conversation

@nguyenv
Copy link
Copy Markdown
Contributor

@nguyenv nguyenv commented Aug 8, 2023

Issue and/or context:

Changes:

  • Cache metadata values when opening the array or group so that it can be accessed in either read or write mode If the SOMAArray or SOMAGroup is already open in read mode, fill the cache by using metadata_num and get_metadata_from_index. If it is open in write, open a temp handle in read mode to fill the metadata mapping and then close the temp handle.
  • Add metadata functions and accompanying unit tests for SOMAObjects
  • get_metadata checks if key exists and returns std::nullopt if DNE

Notes for Reviewer:

N/A

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 8, 2023

Codecov Report

Patch coverage has no change and project coverage change: -11.35% ⚠️

Comparison is base (d7ee2f6) 65.56% compared to head (9ada4bb) 54.22%.
Report is 2 commits behind head on main.

❗ Current head 9ada4bb differs from pull request most recent head 5455352. Consider uploading reports for the commit 5455352 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1584       +/-   ##
===========================================
- Coverage   65.56%   54.22%   -11.35%     
===========================================
  Files         109       75       -34     
  Lines        9221     6324     -2897     
===========================================
- Hits         6046     3429     -2617     
+ Misses       3175     2895      -280     
Flag Coverage Δ
python ?
r 54.22% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 35 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* Metadata getters available  in read and write mode
* Add metadata functions for `SOMAObject`s
* `get_metadata` checks if key exists and returns `std::nullopt` if DNE
@nguyenv nguyenv force-pushed the viviannguyen/access-metadata-any-mode branch from e241405 to 5455352 Compare August 18, 2023 15:36
@nguyenv nguyenv changed the title [c++][wip] Addition of SOMAMetadataMapping [c++] Addition of SOMAMetadataMapping Aug 18, 2023
@nguyenv nguyenv marked this pull request as ready for review August 18, 2023 15:47
@nguyenv nguyenv linked an issue Aug 18, 2023 that may be closed by this pull request
@nguyenv nguyenv marked this pull request as draft August 18, 2023 16:50
@nguyenv nguyenv changed the title [c++] Addition of SOMAMetadataMapping [c++] Allow SOMAObject metadata to be accessible in read and write mode Aug 18, 2023
@nguyenv nguyenv changed the title [c++] Allow SOMAObject metadata to be accessible in read and write mode [c++] Support reading SOMAObject metadata in read and write mode Aug 18, 2023
@nguyenv nguyenv marked this pull request as ready for review August 18, 2023 16:57
Copy link
Copy Markdown
Contributor

@eddelbuettel eddelbuettel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nguyenv nguyenv merged commit ef50ad3 into main Aug 18, 2023
@nguyenv nguyenv deleted the viviannguyen/access-metadata-any-mode branch August 18, 2023 18:02
Comment thread libtiledbsoma/src/soma/soma_object.h
nguyenv pushed a commit that referenced this pull request Aug 24, 2023
* Follow up PR for #1584 (comment)
* `SOMAObject` is meant to be a pure virtual class so all methods should
be virtual
* Update documentation for `get_metadata`
nguyenv pushed a commit that referenced this pull request Aug 24, 2023
* Follow up PR for #1584 (comment)
* `SOMAObject` is meant to be a pure virtual class so all methods should
be virtual
* Update documentation for `get_metadata`
nguyenv pushed a commit that referenced this pull request Aug 24, 2023
* Follow up PR for #1584 (comment)
* `SOMAObject` is meant to be a pure virtual class so all methods should
be virtual
* Update documentation for `get_metadata`
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.

[c++] SOMAObjects need metadata accessible in both read and write mode

4 participants