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

Source keyword arguments #3457

Merged
merged 1 commit into from
Apr 30, 2021

Conversation

coding-chimp
Copy link
Contributor

The dataloader is currently breaking in Ruby 3 when used with sources that have keyword arguments in their constructor. The splat operator in Dataloader#with is transforming the keyword arguments into a hash and if we then try it initialize the source with that hash, it crashes.

This PR fixes that.

MRI supports the new syntax since v2.7 but apparently, that's not the case for TruffleRuby. That's why I'm only using it in Ruby 3. In general, I'm not a fan of having to duplicate code for different ruby versions but I couldn't come up with a better way to make this backward-compatible. 🤔

@rmosolgo rmosolgo added this to the 1.12.9 milestone Apr 30, 2021
@rmosolgo
Copy link
Owner

Thanks for this fix! Sorry I overlooked it in the previous implementation.

@rmosolgo rmosolgo merged commit 289d17b into rmosolgo:master Apr 30, 2021
@coding-chimp coding-chimp deleted the source-keyword-arguments branch April 30, 2021 15:04
@coding-chimp coding-chimp restored the source-keyword-arguments branch April 30, 2021 15:04
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.

2 participants