vaexio / vaex

Out-of-Core hybrid Apache Arrow/NumPy DataFrame for Python, ML, visualization and exploration of big tabular data at a billion rows per second 🚀
https://vaex.io
MIT License
8.28k stars 590 forks source link

[FEATURE-REQUEST]: Expose `vaex.DataFrame` for type hinting #2086

Closed NickCrews closed 2 years ago

NickCrews commented 2 years ago

I would like to add type annotations to my code. Currently I can do from vaex.dataframe import DataFrame, but it would be nice if the DataFrame was exposed at the top level so I could just do import vaex and then df: vaex.DataFrame = ...

I like being able to namespace it like this to differentiate between other DataFrames, eg import pandas as pd and then pdf: pd.DataFrame = ...

I can submit a PR if you want. Thank you for this awesome library, I'm excited to get started with it! Better string processing is a big requirement of mine and this is 💯

NickCrews commented 2 years ago

@JovanVeljanoski any thoughts on this?

maartenbreddels commented 2 years ago

Yeah, I like this.

The only thing I have been sloppy with is making sure 'DataFrame' is the only interface people care about. There are quite a few methods in DataFrameLocal that are not in DataFrame, so the type hinting will be always complete.

cheers,

Maarten

JovanVeljanoski commented 2 years ago

I have no strong opinion on this. @maartenbreddels if you have no objections, we can just do this. Should we proceed?

NickCrews commented 2 years ago

Linked to a PR above. Also exposed Expression, because I often want to type that as well. We didn't discuss that, so leave it out if it's a problem.