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: pass SessionState not SessionConfig to FunctionFactory::create #9837

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

tshauck
Copy link
Contributor

@tshauck tshauck commented Mar 28, 2024

Which issue does this PR close?

Closes #9838.

Rationale for this change

Right now FunctionFactory::create takes a &SessionConfig and not a &SessionState. This limits some of its utility (e.g. access to the object store) and makes it currently out of line with at least TableProviderFactory, which takes a &SessionState as well. The name of the parameter is also state which makes me think that was the original intention.

What changes are included in this PR?

Update the trait signature for FunctionFactory::create so that gets passed &SessionState.

Are these changes tested?

Existing tests around FunctionFactory are mostly unchanged.

Are there any user-facing changes?

Users of FunctionFactory will have to update their code.

Edit: I can't add the api-change label or I would.

@github-actions github-actions bot added the core Core DataFusion crate label Mar 28, 2024
@tshauck tshauck marked this pull request as ready for review March 28, 2024 16:50
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.

This makes sense to me.

cc @milenkovicm do you remember if there is any reason we should only use the SessionConfig rather than SessionState?

@alamb
Copy link
Contributor

alamb commented Mar 28, 2024

Thank you (as always) @tshauck for the clear description and code @tshauck 🙏

@milenkovicm
Copy link
Contributor

I would agree with @tshauck, it was my omission rather than intention. It probably slipped while I was trying to remove locking from my first commit.

thank you @tshauck & @alamb

@milenkovicm
Copy link
Contributor

not sure whats the status with datafusion v.37 release (#9682) , will this PR make it?

@alamb
Copy link
Contributor

alamb commented Mar 28, 2024

not sure whats the status with datafusion v.37 release (#9682) , will this PR make it?

Yes, this shoudl make 37.0.0 I think. I'll plan to make a release tomorrow
I am not sure either -- going to #9682 (comment)

@alamb alamb merged commit 6f9948b into apache:main Mar 28, 2024
27 checks passed
@tshauck tshauck deleted the use-session-state-in-function-factory branch March 28, 2024 20:45
@tshauck
Copy link
Contributor Author

tshauck commented Mar 28, 2024

Thanks @alamb, thanks @milenkovicm

Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update FunctionFactory::create to take the SessionState
3 participants