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

return_type #63

Open
ivirshup opened this issue Apr 3, 2024 · 0 comments
Open

return_type #63

ivirshup opened this issue Apr 3, 2024 · 0 comments
Labels
API enhancement New feature or request P1☕️ Medium priority

Comments

@ivirshup
Copy link
Member

ivirshup commented Apr 3, 2024

Description of feature

It would be nice to have a return_type argument that allowed results other than a pandas dataframe. Currently, I think that pyarrow.Table, ibis.Table, and pd.DataFrame (defaulting to pd.DataFrame would be a good set of options.

This would look like:

ensdb.genes(return_type=ibis.expr.types.Table)

(I generally like the idea of passing a type instead of a string literal here, but I see how the ibis case is unwieldy)

Advantages

Allows us to work with a few use cases:

  • pd.DataFrame: useful for people who don't even need to know they are using SQL. Very much the default dataframe type
  • ibis Table: lazy representation for those who explicitly want to work with the SQL
  • arrow In between, or if you want to pass it to some other library! I believe this also has potential to be lazy via chunks.

Disadvantages

Mainly complexity. Also keeping data types consistent.

It would probably be pretty easy to start with only supporting pandas and ibis, where the ibis case is just not running .execute()

@ivirshup ivirshup added enhancement New feature or request P1☕️ Medium priority API labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request P1☕️ Medium priority
Projects
None yet
Development

No branches or pull requests

1 participant