Thread panics instead of errors #5999
Replies: 7 comments 2 replies
|
What Dima is asking is for the operation to return error instead of panicking. Function signature suggests it can return errors |
1 reply
|
So the real issue is this: Also just for future reference can you paste in the imports and main function so reviewers don't have to do this manually 🙏? Detailsuse std::sync::Arc;
use futures::TryStreamExt;
use vortex::VortexSessionDefault;
use vortex::array::arrays::PrimitiveArray;
use vortex::array::arrays::TemporalArray;
use vortex::buffer::ByteBufferMut;
use vortex::dtype::DType;
use vortex::dtype::ExtDType;
use vortex::dtype::Nullability;
use vortex::dtype::PType;
use vortex::dtype::datetime::TimeUnit;
use vortex::expr::gt;
use vortex::expr::lit;
use vortex::expr::root;
use vortex::scalar::Scalar;
use vortex::session::VortexSession;
use vortex_array::IntoArray;
use vortex_file::OpenOptionsSessionExt;
use vortex_file::WriteOptionsSessionExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let session = VortexSession::default();
// Write file with MILLISECONDS timestamps
let ts_array = PrimitiveArray::from_iter(vec![1704067200000i64, 1704153600000, 1704240000000])
.into_array();
let temporal = TemporalArray::new_timestamp(ts_array, TimeUnit::Milliseconds, None);
let mut buf = ByteBufferMut::empty();
session
.write_options()
.write(&mut buf, temporal.into_array().to_array_stream())
.await?;
// Read with SECONDS filter scalar
let seconds_ext_dtype = Arc::new(ExtDType::new(
vortex::dtype::datetime::TIMESTAMP_ID.clone(),
Arc::new(DType::Primitive(PType::I64, Nullability::Nullable)),
Some(vortex::dtype::datetime::TemporalMetadata::Timestamp(TimeUnit::Seconds, None).into()),
));
let filter_expr = gt(
root(),
lit(Scalar::extension(
seconds_ext_dtype,
Scalar::from(1704153600i64),
)),
);
let stream = session
.open_options()
.open_buffer(buf)?
.scan()?
.with_filter(filter_expr)
.into_array_stream()?;
let results = stream.try_collect::<Vec<_>>().await;
#[expect(clippy::err_expect)]
let err = results.err().expect("not error");
println!("Expected error: {}", err);
Ok(())
} |
1 reply
|
on the latest develop, I am still getting: |
0 replies
|
Working on it. |
0 replies
|
We should validate the extDtype in the ctor |
0 replies
|
We have fixed most of this |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Description
This cases panic with:
Expected Behavior
No panic, get the result as err
Actual Behavior
panic
Reproduction Steps
Run the script above on the latest develop
OS Version Information
MacOS Tahoe
I acknowledge that:
```) on separate lines.All reactions