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

feature: Improve string representation of datafusion classes #159

Merged
merged 6 commits into from
Feb 4, 2023

Conversation

simicd
Copy link
Contributor

@simicd simicd commented Jan 29, 2023

Which issue does this PR close?

Closes #158.

Rationale for this change

Improve developer experience

What changes are included in this PR?

Implement __repr__ methods of the following classes:

  • DataFrame
  • Expression
  • Context
  • Catalog
  • Database
  • Table
  • Config
  • UDAF & UDF

Are there any user-facing changes?

Display additional information when debugging or using REPL tools

@@ -57,8 +57,8 @@ impl PyExpr {
expr.into()
}

fn __str__(&self) -> PyResult<String> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed since redundant if implemented the same way, e.g. str(literal(5)) will fall back to __repr__ if __str__ is not implemented)

@andygrove
Copy link
Member

Thanks @simicd this looks good. We are aware of the build issue #161

Copy link
Contributor

@jdye64 jdye64 left a comment

Choose a reason for hiding this comment

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

@simicd LGTM. Thanks for this. As Andy mentioned we are aware of the CI issue. I just pushed some changes to PR after having Apache infra whitelist a github action for protoc which is what was causing the issue. It might take a few iterations from me there to get it all working but hopefully within a day it should all be sorted out

@jdye64
Copy link
Contributor

jdye64 commented Feb 2, 2023

@andygrove and @simicd sorry for the delay but the CI fix PR is ready for review now if either of you want to take a look #162

@simicd after this merges if you want to merge into this PR your CI build should work as well and we can get your PR merged in.

@simicd simicd force-pushed the feature/improve-repl-output branch from ca47e29 to 0ede908 Compare February 2, 2023 22:30
@simicd
Copy link
Contributor Author

simicd commented Feb 2, 2023

Thanks a lot @jdye64! Checks passed now

@jdye64
Copy link
Contributor

jdye64 commented Feb 3, 2023

@simicd nice! Yep, I don't have commit permissions but looks good now

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

Thanks @simicd

@andygrove andygrove merged commit e89f161 into apache:main Feb 4, 2023
@simicd simicd deleted the feature/improve-repl-output branch February 4, 2023 15:34
@andygrove andygrove added the enhancement New feature or request label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve string representation of datafusion classes (dataframe, context, expression, ...)
3 participants