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

Minor: Add example for configuring SessionContext #12139

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Aug 23, 2024

Which issue does this PR close?

N/A

Rationale for this change

While working on the reprpoducer for #12136 I knew there was a nice builder API added by @Omega359 in #11403 but I couldn't find it quickly in the docs

What changes are included in this PR?

  1. Add new doc example
  2. There is a new pub use for SessionStateBuilder
  3. There is a From impl for SessionState to make the example nicer

Are these changes tested?

yes, by doc CI

Are there any user-facing changes?

Yes, the changes are user facing

here is what the new docs look like

Screenshot 2024-08-23 at 2 57 34 PM

@github-actions github-actions bot added the core Core DataFusion crate label Aug 23, 2024
@@ -19,6 +19,8 @@

pub mod context;
pub mod session_state;
pub use session_state::{SessionState, SessionStateBuilder};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this makes it possible to do

use datafusion::execution::SessionStateBuilder;

@@ -1427,6 +1461,12 @@ impl From<&SessionContext> for TaskContext {
}
}

impl From<SessionState> for SessionContext {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes it possible to do

let ctx = SessionContext::from(state);

@alamb alamb added the documentation Improvements or additions to documentation label Aug 23, 2024
@Omega359
Copy link
Contributor

lgtm, thanks for adding this

@alamb alamb changed the title Add example for configuring SessionContext Minor: Add example for configuring SessionContext Aug 24, 2024
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

👍 thanks @alamb

@comphead comphead merged commit 23ccca9 into apache:main Aug 24, 2024
27 of 28 checks passed
@alamb alamb deleted the alamb/docs_for_session_builder branch August 25, 2024 10:55
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants