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 test for min_max_schema_for_fields #1122

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

marijncv
Copy link
Contributor

@marijncv marijncv commented Feb 5, 2023

Signed-off-by: Marijn Valk marijncv@hotmail.com

Description

Adds tests for min_max_schema_for_fields

Related Issue(s)

Documentation

Signed-off-by: Marijn Valk <marijncv@hotmail.com>
@github-actions github-actions bot added binding/rust Issues for the Rust crate rust labels Feb 5, 2023
Copy link
Collaborator

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

Since max_min_schema_for_fields is meant to be used multiple times on the same destination, perhaps it might be better to combine the tests into one where you call the function on each of the fields, and then assert the final dest result contains the right fields.

Comment on lines 748 to 757
let f = ArrowField::new(
"struct",
ArrowDataType::Struct(vec![ArrowField::new("simple", ArrowDataType::Int32, true)]),
true,
);
let expected = vec![ArrowField::new(
"struct",
ArrowDataType::Struct(vec![ArrowField::new("simple", ArrowDataType::Int32, true)]),
true,
)];
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't have to repeat this, and it's probably clearer they are meant to be the same field if we just clone f. Same applies for test above.

Suggested change
let f = ArrowField::new(
"struct",
ArrowDataType::Struct(vec![ArrowField::new("simple", ArrowDataType::Int32, true)]),
true,
);
let expected = vec![ArrowField::new(
"struct",
ArrowDataType::Struct(vec![ArrowField::new("simple", ArrowDataType::Int32, true)]),
true,
)];
let f = ArrowField::new(
"struct",
ArrowDataType::Struct(vec![ArrowField::new("simple", ArrowDataType::Int32, true)]),
true,
);
let expected = vec![f.clone()];

Signed-off-by: Marijn Valk <marijncv@hotmail.com>
@marijncv
Copy link
Contributor Author

marijncv commented Feb 6, 2023

Thanks for the pointers @wjones127!

Copy link
Collaborator

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

Thanks @marijncv!

@wjones127 wjones127 merged commit 8a82f79 into delta-io:main Feb 6, 2023
@marijncv marijncv deleted the test-min-max-schema-for-fields branch February 12, 2023 10:44
chitralverma pushed a commit to chitralverma/delta-rs that referenced this pull request Mar 17, 2023
Signed-off-by: Marijn Valk <marijncv@hotmail.com>

# Description
Adds tests for `min_max_schema_for_fields`

# Related Issue(s)
<!---
For example:

- closes delta-io#106
--->

# Documentation

<!---
Share links to useful documentation
--->

---------

Signed-off-by: Marijn Valk <marijncv@hotmail.com>
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 rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants