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

Change to comfy-table from prettytable-rs #656

Merged
merged 3 commits into from
Aug 16, 2021
Merged

Change to comfy-table from prettytable-rs #656

merged 3 commits into from
Aug 16, 2021

Conversation

PsiACE
Copy link
Member

@PsiACE PsiACE commented Aug 5, 2021

Signed-off-by: Chojan Shang psiace@outlook.com

Which issue does this PR close?

Closes #69 .

Rationale for this change

comfy-table is still actively maintained.

also, solve RUSTSEC-2018-0015: term is looking for a new maintainer

What changes are included in this PR?

Change to comfy-table from prettytable-rs.

Are there any user-facing changes?

No.

Signed-off-by: Chojan Shang <psiace@outlook.com>
@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 5, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2021

Codecov Report

Merging #656 (6034db9) into master (fa5acd9) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #656   +/-   ##
=======================================
  Coverage   82.43%   82.43%           
=======================================
  Files         168      168           
  Lines       47340    47340           
=======================================
  Hits        39027    39027           
  Misses       8313     8313           

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 fa5acd9...6034db9. Read the comment docs.

@alamb
Copy link
Contributor

alamb commented Aug 6, 2021

Looks good @PsiACE -- thank you -- I will look carefully tomorrow but this looks great

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

All in all I think this is a good change. Thank you @PsiACE

I would like at least one other approval from a maintainer before merging it. Perhaps @andygrove @paddyhoran or @nevi-me have thoughts

If we do go with this change, I don't think we should backport it to the 5.X line -- but instead release it for the first time in 6.0 - 2 months or so (see notes under datafusion section below)

Maintenance

From crates.io it does appear that https://crates.io/crates/prettytable-rs was last updated almost 3 years ago, though it does seem to be very heavily used (though arrow is the third largest user)

https://crates.io/crates/comfy-table/4.0.1 was last updated a month ago and looks more actively maintained, but is less widely used.

This seems like a good tradeoff to me

Dependency Analysis

Looking at the dependencies

cargo tree -p arrow --features=prettyprint

Here are the comfy table dependencies:

├── comfy-table v4.0.1
│   ├── crossterm v0.20.0
│   │   ├── bitflags v1.2.1
│   │   ├── libc v0.2.98
│   │   ├── mio v0.7.13
│   │   │   ├── libc v0.2.98
│   │   │   └── log v0.4.14
│   │   │       └── cfg-if v1.0.0
│   │   ├── parking_lot v0.11.1
│   │   │   ├── instant v0.1.10
│   │   │   │   └── cfg-if v1.0.0
│   │   │   ├── lock_api v0.4.4
│   │   │   │   └── scopeguard v1.1.0
│   │   │   └── parking_lot_core v0.8.3
│   │   │       ├── cfg-if v1.0.0
│   │   │       ├── instant v0.1.10 (*)
│   │   │       ├── libc v0.2.98
│   │   │       └── smallvec v1.6.1
│   │   ├── signal-hook v0.3.9
│   │   │   ├── libc v0.2.98
│   │   │   └── signal-hook-registry v1.4.0
│   │   │       └── libc v0.2.98
│   │   └── signal-hook-mio v0.2.1
│   │       ├── libc v0.2.98
│   │       ├── mio v0.7.13 (*)
│   │       └── signal-hook v0.3.9 (*)
│   ├── strum v0.21.0
│   └── strum_macros v0.21.1 (proc-macro)
│       ├── heck v0.3.3
│       │   └── unicode-segmentation v1.8.0
│       ├── proc-macro2 v1.0.27
│       │   └── unicode-xid v0.2.2
│       ├── quote v1.0.9
│       │   └── proc-macro2 v1.0.27 (*)
│       └── syn v1.0.74
│           ├── proc-macro2 v1.0.27 (*)
│           ├── quote v1.0.9 (*)
│           └── unicode-xid v0.2.2

Here are the dependencies from pretty-table:

├── prettytable-rs v0.8.0
│   ├── atty v0.2.14
│   │   └── libc v0.2.98
│   ├── csv v1.1.6 (*)
│   ├── encode_unicode v0.3.6
│   ├── lazy_static v1.4.0
│   ├── term v0.5.2
│   │   ├── byteorder v1.4.3
│   │   └── dirs v1.0.5
│   │       └── libc v0.2.98
│   └── unicode-width v0.1.8

DataFusion

I also verified that https://github.com/apache/arrow-datafusion would work with this change by patching a local datafusion checkout to use this branch and then running cargo test -p datafusion

There are two differences in the tests reported, both edge cases (empty tables and floating point). I think they are changes for the better but also not strictly speaking backwards compatible. See datafusion-compile-run.txt for the full run

Copy link
Contributor

@paddyhoran paddyhoran left a comment

Choose a reason for hiding this comment

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

It's hard to predict how a library will be maintained in the future but I agree with this change. I'm no expert on this aspect but is there anything we need to do due to it being MIT licensed?

arrow/Cargo.toml Outdated
@@ -49,7 +49,7 @@ packed_simd = { version = "0.3", optional = true, package = "packed_simd_2" }
chrono = "0.4"
flatbuffers = { version = "=2.0.0", optional = true }
hex = "0.4"
prettytable-rs = { version = "0.8.0", optional = true }
comfy-table = { version = "4.0", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add default-features = false. This will allow the prettyprint feature to be enabled in wasm32-wasi target in the next comfy-table release.
Ref: Nukesor/comfy-table#47

FYI @jorgecarleitao

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Chojan Shang <psiace@outlook.com>
@alamb
Copy link
Contributor

alamb commented Aug 16, 2021

I think this has been open long enough for comment. Merging in (will not backport, will plan to release in arrow 6.0.0)

@alamb
Copy link
Contributor

alamb commented Aug 16, 2021

Thanks again @PsiACE

@alamb alamb merged commit 3fa6fcd into apache:master Aug 16, 2021
@PsiACE PsiACE deleted the comfy-table branch August 16, 2021 22:55
ovr pushed a commit to cube-js/arrow-rs that referenced this pull request Apr 16, 2024
* Change to comfy-table

Signed-off-by: Chojan Shang <psiace@outlook.com>

* Apply review

Signed-off-by: Chojan Shang <psiace@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve Issues with prettytable-rs dependency
5 participants