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

[Data] Add read_lance API to read Lance Dataset #45106

Merged
merged 25 commits into from
May 2, 2024

Conversation

c21
Copy link
Contributor

@c21 c21 commented May 2, 2024

Why are these changes needed?

This PR is an update on top of #44853 .

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

brent-anyscale and others added 22 commits May 2, 2024 02:22
This PR adds a new datasource for Ray Data that reads from LanceDB.
This datasource is a thin wrapper around the LanceDB Python client that allows users to read data from LanceDB into Ray Data.

On branch anyscalebrent/lancedb_datasource
Changes to be committed:
	modified:   python/ray/data/__init__.py
	modified:   python/ray/data/datasource/__init__.py
	new file:   python/ray/data/datasource/lancedb_datasource.py
	modified:   python/ray/data/read_api.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/__init__.py
	modified:   python/ray/data/datasource/lancedb_datasource.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/read_api.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/__init__.py
	modified:   python/ray/data/datasource/__init__.py
	renamed:    python/ray/data/datasource/lancedb_datasource.py -> python/ray/data/datasource/lance_datasource.py
	modified:   python/ray/data/read_api.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/__init__.py
	modified:   python/ray/data/datasource/lance_datasource.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/__init__.py
	modified:   python/ray/data/datasource/__init__.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/read_api.py

Signed-off-by: Brent Bain <[email protected]>
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/read_api.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Signed-off-by: Brent Bain <[email protected]>

The __init__ method of the LanceDatasource class now uses Optional instead of Union for the parameters.

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
This change updates lance_datasource to a simpler implementation
of to_batches.

Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Yield isn't working as expected. Changing back to return.

Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
Changes to lance_datasource parallelism handling.
Added initial test for lance_datasource.
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
	modified:   python/ray/data/read_api.py
	new file:   python/ray/data/tests/test_lance.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/datasource/lance_datasource.py
	modified:   python/ray/data/tests/test_lance.py
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/requirements/ml/data-test-requirements.txt
Signed-off-by: Brent Bain <[email protected]>

Changes to be committed:
	modified:   python/ray/data/BUILD
Signed-off-by: Cheng Su <[email protected]>
@c21 c21 force-pushed the anyscalebrent/lancedb_datasource branch from 871ee78 to 9bb0356 Compare May 2, 2024 09:22
@c21 c21 changed the title [Data] Add API to read Lance Dataset [Data] Add read_lance API to read Lance Dataset May 2, 2024
@zhe-thoughts zhe-thoughts assigned c21 and unassigned c21 May 2, 2024
Signed-off-by: Cheng Su <[email protected]>
@c21 c21 merged commit 24bf8a1 into ray-project:master May 2, 2024
5 checks passed
@c21 c21 deleted the anyscalebrent/lancedb_datasource branch May 2, 2024 21:04
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