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

Add DAT tests for Rust #863

Open
wjones127 opened this issue Oct 4, 2022 · 5 comments · May be fixed by #1551
Open

Add DAT tests for Rust #863

wjones127 opened this issue Oct 4, 2022 · 5 comments · May be fixed by #1551
Labels
binding/rust Issues for the Rust crate enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@wjones127
Copy link
Collaborator

Description

Data Acceptance tests should be done for the Rust Arrow reader.

See: https://github.com/delta-incubator/dat

Use Case

Related Issue(s)

@wjones127 wjones127 added enhancement New feature or request binding/rust Issues for the Rust crate labels Oct 4, 2022
@wjones127 wjones127 added the good first issue Good for newcomers label Jan 26, 2023
@microcassidy
Copy link

@wjones127 is this still current? (If so) how would you like to see this completed?

@wjones127
Copy link
Collaborator Author

Yes, this is still current. We have these for the Python bindings, but not for Rust.

For reference, here are the scripts for the Python tests:

So we'd want something parallel to that. This could be based on the load operation, or perhaps the DataFusion TableProvider.

It might be a bit challenging to write in Rust, since the tests need to be generated based on the contents of a directory. You can see the approach delta-kernel-rs took here: https://github.com/delta-incubator/delta-kernel-rs/blob/main/tests/dat_reader.rs

@microcassidy
Copy link

microcassidy commented Jul 20, 2023

@wjones127 I have been playing around with it and it looks like a way around it might be to infer the folders from the version of the input delta table. The test could be put into a macro maybe?

#[macro_export]
macro_rules! eg_dat_test {
    ($( $test_name:ident $test:literal),*) => {
        $(
            #[tokio::test]
            async fn $test_name()->TestResult{
                //some body
                let root = Path::new("someroot");
                let path = root.join(Path::new($test));
                //etc etc....
                Ok(())
            }
        )*
    }
}

eg_dat_test!(
    test_foo "bar",
    test_ram "ram"
);

@wjones127
Copy link
Collaborator Author

Yes something like that may work. Feel free to create a draft PR for discussion.

@microcassidy microcassidy linked a pull request Jul 21, 2023 that will close this issue
@microcassidy
Copy link

Cool. I have put in a draft. There are some parts missing but the idea seems to be working mostly

@rtyler rtyler added this to the Rust v0.18 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/rust Issues for the Rust crate enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants