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: add to_list and to_pandas api's #556

Merged
merged 1 commit into from
Oct 11, 2023
Merged

Conversation

changhiskhan
Copy link
Contributor

Add to_list to return query results as list of python dict (so we're not too pandas-centric). Closes #555

Add to_pandas API and add deprecation warning on to_df. Closes #545

Copy link
Contributor

@rok rok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's two more to_dfs here:

" f\"duckdb.sql('{query}').to_df()\"\n",
" ) \n",
" diffusiondb = tbl.to_lance()\n",
" return (_extract(duckdb.sql(query).to_df()), code)\n",

Looks good otherwise.

Edit: nevermind, that's duckdb

@@ -80,14 +80,14 @@ def handler(event, context):
# Shape of SIFT is (128,1M), d=float32
query_vector = np.array(event['query_vector'], dtype=np.float32)

rs = table.search(query_vector).limit(2).to_df()
rs = table.search(query_vector).limit(2).to_list()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does rs stand for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResultSet

@changhiskhan changhiskhan merged commit e1ae2bc into main Oct 11, 2023
11 checks passed
@changhiskhan changhiskhan deleted the changhiskhan/to_pandas branch October 11, 2023 19:18
raghavdixit99 pushed a commit to raghavdixit99/lancedb that referenced this pull request Apr 5, 2024
Add `to_list` to return query results as list of python dict (so we're
not too pandas-centric). Closes lancedb#555

Add `to_pandas` API and add deprecation warning on `to_df`. Closes lancedb#545

Co-authored-by: Chang She <chang@lancedb.com>
westonpace pushed a commit that referenced this pull request Apr 5, 2024
Add `to_list` to return query results as list of python dict (so we're
not too pandas-centric). Closes #555

Add `to_pandas` API and add deprecation warning on `to_df`. Closes #545

Co-authored-by: Chang She <chang@lancedb.com>
alexkohler pushed a commit to alexkohler/lancedb that referenced this pull request Apr 20, 2024
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.

add to_list api for query results Unify to_pandas() and to_df() for a cleaner API interface
2 participants