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

add support for polars >= 0.8 #154

Merged
merged 1 commit into from
Nov 3, 2021
Merged

Conversation

wseaton
Copy link
Collaborator

@wseaton wseaton commented Nov 3, 2021

Currently connectorx pins the version of polars to 0.8.*, but it's possible to add support for later versions of polars without breaking backwards compatibility by just attempting the import and catching the exception. What do y'all think? I'm also open to a ranged dependency, something like >=0.8,<0.11 that we could simply increment if there are no additional API breaks.

(cc @ritchie46)

@dovahcrow
Copy link
Member

dovahcrow commented Nov 3, 2021

@wseaton What is the guarantee for the version number in Polars? In Semver it only guarantees no breaking changes between 0.x.y and 0.x.z, but not between 0.x and 0.y. If Polars has a different guarantee, e.g. no breaking changes until 1.0, we could definitely do >=0.8.

I'm worrying that catching the exception for the import is not enough.

@wseaton
Copy link
Collaborator Author

wseaton commented Nov 3, 2021

@dovahcrow good point, I think I'd defer to @ritchie46 on any future plans for change. The from_arrow API is one of the most foundational APIs of the library, so I'd hope it wouldn't be changing any more between versions and can be considered 'settled code'.

As for the brittleness of the import shim, a polars 1.0 user could just use return_type='arrow' as a workaround if this in the future was to ever break so there's at least an escape hatch.

@dovahcrow
Copy link
Member

@dovahcrow good point, I think I'd defer to @ritchie46 on any future plans for change. The from_arrow API is one of the most foundational APIs of the library, so I'd hope it wouldn't be changing any more between versions and can be considered 'settled code'.

As for the brittleness of the import shim, a polars 1.0 user could just use return_type='arrow' as a workaround if this in the future was to ever break so there's at least an escape hatch.

Sounds good to me for ">=0.8" if from_arrow is considered settled.

@ritchie46
Copy link
Contributor

Polars has breaking changes on the x in 0.x.y. That said, the API is stabilizing and I cannot imagine pl.from_arrow to be deprecated. Given that version 0.8 is pretty old (in Polars lifetime 😄), I'd only support a more recent version.

@dovahcrow
Copy link
Member

Let's merge this PR then. I think from_arrow is the only function we require from Polars.

@dovahcrow dovahcrow merged commit 4813a79 into sfu-db:main Nov 3, 2021
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.

3 participants