Skip to content

Conversation

sinistersnare
Copy link
Contributor

@sinistersnare sinistersnare commented Jun 13, 2025

This PR adds a test that crashes the test suite. It does not provide a fix, so the PR is marked as a draft for now.

Currently Perspective aborts in the C++ by updating a table with a CSV that has no header.

tbl = Table({ "stringcol": "string" })
tbl.update("rowval  \n another row val")

Results in Fatal Python error: Aborted

This bug also occurs in Rust, see the example in the below comment

Signed-off-by: Davis Silverman <[email protected]>
@sinistersnare sinistersnare changed the title Add a failing test awaiting a fix Add a failing test for updating a table with a headerless CSV. Jun 13, 2025
@sinistersnare
Copy link
Contributor Author

Here is the Rust example:

use std::error::Error;

use perspective::client::{ColumnType, TableData, UpdateData};
use perspective::server::Server;

#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<(), Box<dyn Error>> {
    let server = Server::default();
    let client = server.new_local_client();
    let schema = TableData::Schema(vec![("stringcol".into(), ColumnType::String)]);
    let table = client.table(schema, Default::default()).await?;
    // Note: No header row!
    let update = UpdateData::Csv("A\nB\n".to_string());
    table.update(update, Default::default()).await?;
    let csv = table.view(None).await?.to_csv(Default::default()).await?;
    println!("CSV:: {csv:?}");
    client.close().await;
    Ok(())
}
$ cargo run
   Compiling example_repo v1.0.0 (/Path/To/Example)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.53s
     Running `target/debug/example_repo`
libc++abi: terminating due to uncaught exception of type std::invalid_argument: stoll: no conversion
[1]    19940 abort      cargo run

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.

1 participant