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

feat: add polars_info function #271

Merged
merged 16 commits into from
Jun 30, 2023
Merged

Conversation

eitsupi
Copy link
Collaborator

@eitsupi eitsupi commented Jun 28, 2023

Based on #262, close #269

Implement a function like arrow::arrow_info()

> polars_info()
R Polars package version: 0.6.1.9000

Features:          
simd FALSE

It provides fairly limited information for now, but other information can be added in the future.

@sorhawell
Copy link
Collaborator

good idea

the py-polars equivalent

>>> pl.show_versions()
--------Version info---------
Polars:      0.18.4
Index type:  UInt32
Platform:    macOS-12.6.6-x86_64-i386-64bit 
Python:      3.10.9 (main, Dec 15 2022, 18:18:30) [Clang 14.0.0 (clang-1400.0.29.202)]

----Optional dependencies---- 
numpy:       1.24.3
pandas:      <not installed>
pyarrow:     12.0.0
connectorx:  <not installed>
deltalake:   <not installed>
fsspec:      <not installed>
matplotlib:  <not installed>
xlsx2csv:    <not installed>
xlsxwriter:  <not installed>
>>> 

@eitsupi eitsupi marked this pull request as ready for review June 29, 2023 01:47
Copy link
Collaborator

@etiennebacher etiennebacher left a comment

Choose a reason for hiding this comment

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

LGTM, can you add a snapshot test?

cat("\n")
}

cat("R Polars package version: ", format(x$version), "\n\n", sep = "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it possible to have the rust-polars version as well? (and does it make sense to display it?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point.
But we uses unreleased version of rust-polars here, so I think showing rust-polars' version make little sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Upon further investigation, it seems that there is no constant in rust-polars to display the version.
So I think we need to update rust-polars first to do that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have opened an issue about that. pola-rs/polars#9659

@eitsupi
Copy link
Collaborator Author

eitsupi commented Jun 29, 2023

can you add a snapshot test?

I was hesitant to add a snapshot test, given that results can vary depending on build conditions.
But perhaps by forcing the values to be overwritten, only print results can be tested...

Copy link
Collaborator

@etiennebacher etiennebacher left a comment

Choose a reason for hiding this comment

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

Thank you @eitsupi

NEWS.md Outdated Show resolved Hide resolved
tests/testthat/test-info.R Outdated Show resolved Hide resolved
@etiennebacher etiennebacher merged commit 74b0fde into pola-rs:main Jun 30, 2023
8 checks passed
@eitsupi eitsupi deleted the polars-info branch June 30, 2023 12:02
@eitsupi
Copy link
Collaborator Author

eitsupi commented Jun 30, 2023

Sorry, I may have made a mistake on something.......
On the website after this PR is merged, simd shows FALSE as follows.
This should be TRUE.......

polars_info()
#> R Polars package version: 0.6.1.9000
#> 
#> Features:          
#> simd FALSE
#> 

@eitsupi
Copy link
Collaborator Author

eitsupi commented Jun 30, 2023

Now I understand why. I had misunderstood the use of target_feature.
https://doc.rust-lang.org/reference/attributes/codegen.html#the-target_feature-attribute

I should use feature, not target_feature...

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.

polars_info() function
3 participants