Skip to content

chore: Remove Status from ArraySchema, Attribute, Dimension, Domain #5541

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rroelke
Copy link
Member

@rroelke rroelke commented Jun 11, 2025

There are a number of old stories which refer to "un-Statusing" various parts of the code. I can imagine some benefits of doing this, but a new one concerns our upcoming interoperability with Rust code.

The Rust crate we use to interoperate with C++, cxx, can generate idiomatic bindings in Rust to use types and call functions which are defined in C++. These bindings can declare and use "opaque" types, i.e. types whose definitions reside within C++ and are invisible to Rust code. However, these types cannot be passed by value to and from Rust functions.

Status is commonly used as a return value from our internal C++ code. This prevents us from declaring bindings for those functions in cxx and thus calling them from Rust. We probably cannot migrate Status from an opaque type to a shared type, but we can "un-Status" the functions we want to use.

This pull request "un-Statuses" the methods of classes in the array_schema directory. This will eventually allow them to be called from Rust code.


TYPE: NO_HISTORY
DESC: Un-Status array_schema methods

@rroelke rroelke requested a review from bekadavis9 June 11, 2025 00:57
@@ -515,25 +512,25 @@ class ArraySchema {
* Sets whether the array allows coordinate duplicates.
* It errors out if set to `1` for dense arrays.
*/
Status set_allows_dups(bool allows_dups);
void set_allows_dups(bool allows_dups);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above. Should return bool. I won't continue to mark the rest of these for both of our sake :')

Copy link
Member Author

Choose a reason for hiding this comment

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

Only has_dimension and has_attribute have value which can now be return this way, the other affected functions do not have out arguments.

if (domain == nullptr) {
return;
}
throw DimensionException(
std::string("Setting the domain to a dimension with type '") +
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: no need to cast the exception body to std::string. Rings true throughout PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed for the concatenation

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