Commit Graph

235 Commits

Author SHA1 Message Date
Chang She c97ae6b787 chore(python): update embedding API to use openai 1.6.1 (#751)
API has changed significantly, namely `openai.Embedding.create` no
longer exists.
https://github.com/openai/openai-python/discussions/742

Update the OpenAI embedding function and put a minimum on the openai sdk
version.
2024-04-05 16:24:47 -07:00
Chang She 7bac1131fb feat: add timezone handling for datetime in pydantic (#578)
If you add timezone information in the Field annotation for a datetime
then that will now be passed to the pyarrow data type.

I'm not sure how pyarrow enforces timezones, right now, it silently
coerces to the timezone given in the column regardless of whether the
input had the matching timezone or not. This is probably not the right
behavior. Though we could just make it so the user has to make the
pydantic model do the validation instead of doing that at the pyarrow
conversion layer.
2024-04-05 16:24:47 -07:00
Chang She a0afa84786 feat(python): add post filtering for full text search (#739)
Closes #721 

fts will return results as a pyarrow table. Pyarrow tables has a
`filter` method but it does not take sql filter strings (only pyarrow
compute expressions). Instead, we do one of two things to support
`tbl.search("keywords").where("foo=5").limit(10).to_arrow()`:

Default path: If duckdb is available then use duckdb to execute the sql
filter string on the pyarrow table.
Backup path: Otherwise, write the pyarrow table to a lance dataset and
then do `to_table(filter=<filter>)`

Neither is ideal. 
Default path has two issues:
1. requires installing an extra library (duckdb)
2. duckdb mangles some fields (like fixed size list => list)

Backup path incurs a latency penalty (~20ms on ssd) to write the
resultset to disk.

In the short term, once #676 is addressed, we can write the dataset to
"memory://" instead of disk, this makes the post filter evaluate much
quicker (ETA next week).

In the longer term, we'd like to be able to evaluate the filter string
on the pyarrow Table directly, one possibility being that we use
Substrait to generate pyarrow compute expressions from sql string. Or if
there's enough progress on pyarrow, it could support Substrait
expressions directly (no ETA)

---------

Co-authored-by: Will Jones <willjones127@gmail.com>
2024-04-05 16:24:47 -07:00
Lance Release d1f24ba1dd [python] Bump version: 0.4.0 → 0.4.1 2024-04-05 16:24:47 -07:00
Will Jones 48a12e780c upgrade lance to v0.9.1 (#727)
This brings in some important bugfixes related to take and aarch64
Linux. See changes at:
https://github.com/lancedb/lance/releases/tag/v0.9.1
2024-04-05 16:24:30 -07:00
Lance Release acbcbe6496 [python] Bump version: 0.3.6 → 0.4.0 2024-04-05 16:24:30 -07:00
Lei Xu 1d79e9168e chore: bump lance version to 0.9 (#715) 2024-04-05 16:24:30 -07:00
Lance Release 811e604077 [python] Bump version: 0.3.5 → 0.3.6 2024-04-05 16:24:30 -07:00
Lance Release fc32f98c34 [python] Bump version: 0.3.4 → 0.3.5 2024-04-05 16:24:30 -07:00
Will Jones 9356c3b86a feat(python): add update query support for Python (#654)
Closes #69

Will not pass until https://github.com/lancedb/lance/pull/1585 is
released
2024-04-05 16:24:29 -07:00
Lance Release 8f82e4897c [python] Bump version: 0.3.3 → 0.3.4 2024-04-05 16:23:49 -07:00
Will Jones 6d76fe80b8 chore: upgrade lance to v0.8.17 (#656)
Readying for the next Lance release.
2024-04-05 16:23:49 -07:00
Ayush Chaurasia c0a49a9a5b Multi-task instructor model with quantization support & weak_lru cache for embedding function models (#612)
resolves #608
2024-04-05 16:23:49 -07:00
Lei Xu 86efd36689 chore: improve create_table API consistency between local and remote SDK (#627) 2024-04-05 16:23:47 -07:00
Lance Release c1b037f0a5 [python] Bump version: 0.3.2 → 0.3.3 2024-04-05 16:23:14 -07:00
Lei Xu 3855bdf986 chore: bump lance to 8.10 (#622) 2024-04-05 16:23:14 -07:00
Will Jones 166b281d66 increment pylance (#618) 2024-04-05 16:22:59 -07:00
Lance Release a3c955070e [python] Bump version: 0.3.1 → 0.3.2 2024-04-05 16:22:59 -07:00
Bert edeecd3d9f update lance to 0.8.7 (#598) 2024-04-05 16:22:59 -07:00
Will Jones e37a0566e0 Revert "[python] Bump version: 0.3.2 → 0.3.3"
This reverts commit c30faf6083.
2024-04-05 16:22:59 -07:00
Will Jones 48999ffc27 [python] Bump version: 0.3.2 → 0.3.3 2024-04-05 16:22:59 -07:00
Chang She 31334b05df chore: bump lance version in python/rust lancedb (#584)
To include latest v0.8.6

Co-authored-by: Chang She <chang@lancedb.com>
2024-04-05 16:22:59 -07:00
Ayush Chaurasia 507f6087c2 [Python]Embeddings API refactor (#580)
Sets things up for this -> https://github.com/lancedb/lancedb/issues/579
- Just separates out the registry/ingestion code from the function
implementation code
- adds a `get_registry` util
- package name "open-clip" -> "open-clip-torch"
2024-04-05 16:22:59 -07:00
Lei Xu 7b5bfadab2 chore: bump lance to 0.8.5 (#561)
Bump lance to 0.5.8
2024-04-05 16:22:59 -07:00
Lance Release 87c69e74fc [python] Bump version: 0.3.0 → 0.3.1 2024-04-05 16:22:59 -07:00
Ayush Chaurasia 0e9a7f0dc7 Add cohere embedding function (#550) 2024-04-05 16:22:59 -07:00
Chang She 8469d010f8 feat: add to_list and to_pandas api's (#556)
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>
2024-04-05 16:22:59 -07:00
Lei Xu a26c8f3316 feat: use GPU for index creation. (#540)
Bump lance to 0.8.3 to include GPU training

---------

Co-authored-by: Rob Meng <rob.xu.meng@gmail.com>
2023-10-05 20:49:00 -07:00
Lance Release a022368426 [python] Bump version: 0.2.6 → 0.3.0 2023-10-03 21:48:22 +00:00
Lei Xu 8b815ef5a8 chore: upgrade lance to 0.8.1 (#536)
Bump to lance 0.8.1 for both javascript and python sdk
2023-10-03 14:29:18 -07:00
Lance Release d326146a40 [python] Bump version: 0.2.5 → 0.2.6 2023-10-01 17:48:59 +00:00
Chang She 693bca1eba feat(python): expose prefilter to lancedb (#522)
We have experimental support for prefiltering (without ANN) in pylance.
This means that we can now apply a filter BEFORE vector search is
performed. This can be done via the `.where(filter_string,
prefilter=True)` kwargs of the query.

Limitations:
- When connecting to LanceDB cloud, `prefilter=True` will raise
NotImplemented
- When an ANN index is present, `prefilter=True` will raise
NotImplemented
- This option is not available for full text search query
- This option is not available for empty search query (just
filter/project)

Additional changes in this PR:
- Bump pylance version to v0.8.0 which supports the experimental
prefiltering.

---------

Co-authored-by: Chang She <chang@lancedb.com>
2023-10-01 10:34:12 -07:00
Will Jones 343e274ea5 fix: define minimum dependency versions (#515)
Closes #513

For each of these, I found the minimum version that would allow the unit
tests to pass.
2023-09-29 09:04:49 -07:00
Hynek Schlawack bc8670d7af [Python] Fix attrs dependency (#508)
The `attr` project is unrelated to `attrs` that also provides the `attr`
namespace (see also <https://hynek.me/articles/import-attrs/>).

It used to _usually_ work, because attrs is a dependency of aiohttp and
somehow took precedence over `attr`'s `attr`.

Yes, sorry, it's a mess.
2023-09-21 12:35:34 -04:00
Lance Release 74004161ff [python] Bump version: 0.2.4 → 0.2.5 2023-09-19 16:43:06 +00:00
Chang She 31dad71c94 multi-modal embedding-function (#484) 2023-09-16 21:23:51 -04:00
Lance Release 8dc2315479 [python] Bump version: 0.2.3 → 0.2.4 2023-09-15 14:23:26 +00:00
Rob Meng f6bfb5da11 chore: upgrade lance to 0.7.4 (#491) 2023-09-14 16:02:23 -04:00
Lance Release 661fcecf38 [python] Bump version: 0.2.2 → 0.2.3 2023-09-14 17:48:32 +00:00
Lei Xu 6799613109 feat: upgrade lance to 0.7.3 (#481) 2023-09-07 17:01:45 -07:00
Chang She 9a9a73a65d [python] Use pydantic for embedding function persistence (#467)
1. Support persistent embedding function so users can just search using
query string
2. Add fixed size list conversion for multiple vector columns
3. Add support for empty query (just apply select/where/limit).
4. Refactor and simplify some of the data prep code

---------

Co-authored-by: Chang She <chang@lancedb.com>
Co-authored-by: Weston Pace <weston.pace@gmail.com>
2023-09-05 21:30:45 -07:00
Lance Release fe8848efb9 [python] Bump version: 0.2.1 → 0.2.2 2023-08-24 23:18:10 +00:00
Lance Release 909b7e90cd [python] Bump version: 0.2.0 → 0.2.1 2023-08-24 04:00:11 +00:00
QianZhu ae8486cc8f bump lance version to 0.6.5 for lancedb release (#453) 2023-08-23 20:59:03 -07:00
Lance Release b1a5c251ba [python] Bump version: 0.1.16 → 0.2.0 2023-08-12 04:43:16 +00:00
Will Jones 722462c38b chore: upgrade Lance and rename score to _distance (#398)
BREAKING CHANGE: The `score` column has been renamed to `_distance` to
more accurately describe the semantics (smaller means closer / better).

---------

Co-authored-by: Lei Xu <lei@lancedb.com>
2023-08-11 21:42:33 -07:00
Lei Xu f0e1290ae6 Restrict semver version to 3.0 (#389) 2023-07-31 22:26:24 -07:00
Lance Release b06e214d29 [python] Bump version: 0.1.15 → 0.1.16 2023-07-31 18:32:40 +00:00
gsilvestrin 1daecac648 fix(python): Pin pylance and add pandas as test dependency (#373) 2023-07-27 15:21:45 -07:00
Lance Release 0e4050e706 [python] Bump version: 0.1.14 → 0.1.15 2023-07-25 18:58:44 +00:00