-
Notifications
You must be signed in to change notification settings - Fork 195
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
Conversation
@@ -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); |
There was a problem hiding this comment.
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 :')
There was a problem hiding this comment.
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 '") + |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
echo "START tiledb_regression" | ||
./test/regression/tiledb_regression -d yes | ||
echo "END tiledb_regression" | ||
|
||
echo "START tiledb_regression" | ||
./test/ci/test_assert -d yes | ||
echo "END tiledb_regression" | ||
|
||
echo "START tiledb_unit" | ||
./test/tiledb_unit -d yes "~[rapidcheck]" | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' | ||
echo "END tiledb_unit" | ||
|
||
echo "START unit_vfs" | ||
./tiledb/sm/filesystem/test/unit_vfs -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' | ||
echo "END unit_vfs" | ||
|
||
# Run rapidcheck tests as their own process so we can see the random seed for each | ||
./test/tiledb_unit --list-tests "[rapidcheck]" --verbosity quiet | while IFS= read -r testname; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "START tiledb_regression" | |
./test/regression/tiledb_regression -d yes | |
echo "END tiledb_regression" | |
echo "START tiledb_regression" | |
./test/ci/test_assert -d yes | |
echo "END tiledb_regression" | |
echo "START tiledb_unit" | |
./test/tiledb_unit -d yes "~[rapidcheck]" | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' | |
echo "END tiledb_unit" | |
echo "START unit_vfs" | |
./tiledb/sm/filesystem/test/unit_vfs -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' | |
echo "END unit_vfs" | |
# Run rapidcheck tests as their own process so we can see the random seed for each | |
./test/tiledb_unit --list-tests "[rapidcheck]" --verbosity quiet | while IFS= read -r testname; do | |
echo "START tiledb_regression" | |
./test/regression/tiledb_regression -d yes | |
echo "START tiledb_regression" | |
./test/ci/test_assert -d yes | |
echo "START tiledb_unit" | |
./test/tiledb_unit -d yes "~[rapidcheck]" | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' | |
echo "START unit_vfs" | |
./tiledb/sm/filesystem/test/unit_vfs -d yes | awk '/1: ::set-output/{sub(/.*1: /, ""); print; next} 1' | |
# Run rapidcheck tests as their own process so we can see the random seed for each | |
echo "START tiledb_unit rapidcheck" | |
./test/tiledb_unit --list-tests "[rapidcheck]" --verbosity quiet | while IFS= read -r testname; do |
We don't need both start and end messages, since starting an operation implies that the previous one ended.
"[TileDB::Dimension] Error: Dimension: Coordinate -682.75 is out of " | ||
"domain bounds [-682.73999, 929.42999] on dimension 'Z'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to do for this PR, but the format of our error messages has lots of room for improvement.
if (std::isinf(domain[0]) || std::isinf(domain[1])) { | ||
throw DimensionException("Domain check failed; domain contains NaN"); | ||
} | ||
if (std::isnan(domain[0]) || std::isnan(domain[1])) { | ||
throw DimensionException("Domain check failed; domain contains NaN"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (std::isinf(domain[0]) || std::isinf(domain[1])) { | |
throw DimensionException("Domain check failed; domain contains NaN"); | |
} | |
if (std::isnan(domain[0]) || std::isnan(domain[1])) { | |
throw DimensionException("Domain check failed; domain contains NaN"); | |
} | |
if (!(std::isfinite(domain[0]) && std::isfinite(domain[1]))) { | |
throw DimensionException("Domain check failed; domain cannot contain NaN or Infinity"); | |
} |
There are a number of old stories which refer to "un-
Status
ing" 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 incxx
and thus calling them from Rust. We probably cannot migrateStatus
from an opaque type to a shared type, but we can "un-Status
" the functions we want to use.This pull request "un-
Status
es" the methods of classes in thearray_schema
directory. This will eventually allow them to be called from Rust code.TYPE: NO_HISTORY
DESC: Un-Status array_schema methods