Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Replaced Display by Debug for Array #694

Merged
merged 1 commit into from
Dec 21, 2021
Merged

Replaced Display by Debug for Array #694

merged 1 commit into from
Dec 21, 2021

Conversation

jorgecarleitao
Copy link
Owner

@jorgecarleitao jorgecarleitao commented Dec 20, 2021

Currently representing arrays in Debug is a bit verbose. This was useful to iterate over the struct definitions, but as the API stabilizes, we can move to less verbose representations.

This PR goes in this direction by removing the impl Display of the Array and by making the Debug one equal to the current Display one. This allows users to impl Debug on structs that contain arrays and have an easier to read string representation.

This follows the same design used by std::Vec, which does not present the struct details to the users.

This also removes the Display implementation to the datatypes, since it was equal to Debug (and there is no natural Display for them in Arrow).

@jorgecarleitao
Copy link
Owner Author

A side product of this is that the assert_eq of two arrays is much easier to read.

@codecov
Copy link

codecov bot commented Dec 20, 2021

Codecov Report

Merging #694 (bd8ae0e) into main (f64339c) will increase coverage by 0.04%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #694      +/-   ##
==========================================
+ Coverage   69.77%   69.82%   +0.04%     
==========================================
  Files         303      303              
  Lines       16855    16905      +50     
==========================================
+ Hits        11761    11804      +43     
- Misses       5094     5101       +7     
Impacted Files Coverage Δ
src/array/boolean/mod.rs 82.35% <ø> (ø)
src/array/dictionary/mod.rs 64.51% <0.00%> (ø)
src/array/fixed_size_binary/mod.rs 69.62% <ø> (ø)
src/array/fixed_size_list/mod.rs 69.35% <0.00%> (ø)
src/array/null.rs 38.23% <ø> (ø)
src/array/primitive/mutable.rs 84.71% <0.00%> (ø)
src/array/struct_/mod.rs 56.92% <0.00%> (ø)
src/array/union/mod.rs 79.80% <ø> (ø)
src/array/utf8/mod.rs 87.17% <0.00%> (ø)
src/compute/aggregate/min_max.rs 66.66% <ø> (ø)
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f64339c...bd8ae0e. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant