Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Metadata and GroupMetadata into one Python class #2099

Merged

Conversation

kounelisagis
Copy link
Member

@kounelisagis kounelisagis commented Oct 24, 2024

Following #2085, this PR removes the Cython Metadata class and renames Python's GroupMetadata class to Metadata. The new Metadata class is now shared between the Array and Group classes, as both classes now have a self._meta property that is an instance of this class.
Additionally, the common pybind11 code has been moved to a separate metadata.cc file, within an adapter templated class that works for both the Array and Group classes.

CI: https://github.com/TileDB-Inc/TileDB-Py/actions/runs/11503873688


[sc-54605]

@kounelisagis
Copy link
Member Author

After further consideration, I believe this change will break backward compatibility. More testing is needed, specifically writing metadata with older tiledb-py versions and reading it with this version, and vice versa.

@kounelisagis kounelisagis marked this pull request as draft October 25, 2024 13:58
@kounelisagis kounelisagis force-pushed the agis/merge-metadata-and-groupmetadata-classes branch from 63a2d49 to d085808 Compare October 29, 2024 12:07
@kounelisagis kounelisagis force-pushed the agis/merge-metadata-and-groupmetadata-classes branch from d085808 to 27b9ec9 Compare October 29, 2024 12:09
@kounelisagis kounelisagis marked this pull request as ready for review October 29, 2024 12:10
@kounelisagis kounelisagis force-pushed the agis/merge-metadata-and-groupmetadata-classes branch from 27b9ec9 to c9098ab Compare October 29, 2024 12:26
@kounelisagis
Copy link
Member Author

In #2099, backward compatibility has been fixed.

After rebasing the pybind11-full branch onto the dev branch, and then rebasing the current branch onto pybind11-full, this PR is now ready for review.

Copy link
Collaborator

@nguyenv nguyenv left a comment

Choose a reason for hiding this comment

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

This looks great! Using a template for the MetadataAdapter class so that it can take both arrays and groups is really clever.

@kounelisagis kounelisagis merged commit d199a86 into pybind11-full Oct 30, 2024
27 checks passed
@kounelisagis kounelisagis deleted the agis/merge-metadata-and-groupmetadata-classes branch October 30, 2024 21:39
namespace py = pybind11;
using namespace pybind11::literals;

template <typename T> class MetadataAdapter {
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

kounelisagis added a commit that referenced this pull request Dec 9, 2024
* Delete Cython
* Add new pybind11 Adapter class
* Move Python class + fixes
* Fix tests
kounelisagis added a commit that referenced this pull request Dec 20, 2024
* Delete Cython
* Add new pybind11 Adapter class
* Move Python class + fixes
* Fix tests
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.

3 participants