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

docs: add docs and example showing how to get the expression data type #9118

Merged
merged 3 commits into from
Feb 4, 2024

Conversation

r3stl355
Copy link
Contributor

@r3stl355 r3stl355 commented Feb 3, 2024

Which issue does this PR close?

Closes #7725

Rationale for this change

Make it easier to understand what the get_type returns

What changes are included in this PR?

Are these changes tested?

An extra example in datafusion-examples/examples/expr_api.rs
Docscring in datafusion/expr/src/expr_schema.rs
A paragraph in docs/source/library-user-guide/working-with-exprs.md

Are there any user-facing changes?

Only documentation and an example, no breaking changes

…ssion

Signed-off-by: Nikolay Ulmasov <ulmasov@hotmail.com>
@github-actions github-actions bot added the logical-expr Logical plan and expressions label Feb 3, 2024
@r3stl355
Copy link
Contributor Author

r3stl355 commented Feb 3, 2024

Few issues with the docstrings. I can resolve some by using lib names instead of fully qualified (e.g. datafusion_expr instead of datafusion::logical_expr) but arrow_schema::DataType requires an arrow-schema dependency which I don't want to add to Cargo.toml just for this. Should I mark the docstring as ignore?

Ignore this comment, found another way

Signed-off-by: Nikolay Ulmasov <ulmasov@hotmail.com>
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.

Thank you @r3stl355 -- this looks great ❤️ . It will be very helpful

I had some small suggestions but I also think we could do them as follow on PRs (or never)

datafusion-examples/examples/expr_api.rs Outdated Show resolved Hide resolved
datafusion-examples/examples/expr_api.rs Show resolved Hide resolved
datafusion-examples/examples/expr_api.rs Outdated Show resolved Hide resolved
datafusion-examples/examples/expr_api.rs Show resolved Hide resolved
datafusion/expr/src/expr_schema.rs Show resolved Hide resolved
docs/source/library-user-guide/working-with-exprs.md Outdated Show resolved Hide resolved
@r3stl355
Copy link
Contributor Author

r3stl355 commented Feb 4, 2024

I had some small suggestions but I also think we could do them as follow on PRs (or never)

@alamb I'll make these changes later today, this is not merged yet so I don't see a reason for not implementing them

Update: I made all the suggested changes

Signed-off-by: Nikolay Ulmasov <ulmasov@hotmail.com>
@alamb alamb merged commit 86a2ab0 into apache:main Feb 4, 2024
23 checks passed
@alamb
Copy link
Contributor

alamb commented Feb 4, 2024

Thanks again @r3stl355

@r3stl355 r3stl355 deleted the issue-7725 branch February 4, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docs] How to get data type of a logical expression
2 participants