lance-nd 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. lance_nd-0.1.0/.github/workflows/ci.yml +104 -0
  2. lance_nd-0.1.0/.github/workflows/crates.yml +52 -0
  3. lance_nd-0.1.0/.github/workflows/pypi.yml +110 -0
  4. lance_nd-0.1.0/.gitignore +44 -0
  5. lance_nd-0.1.0/Cargo.lock +6960 -0
  6. lance_nd-0.1.0/Cargo.toml +36 -0
  7. lance_nd-0.1.0/FORMAT.md +134 -0
  8. lance_nd-0.1.0/LICENSE +201 -0
  9. lance_nd-0.1.0/PKG-INFO +94 -0
  10. lance_nd-0.1.0/README.md +107 -0
  11. lance_nd-0.1.0/assets/logo-wordmark.svg +43 -0
  12. lance_nd-0.1.0/assets/logo.svg +34 -0
  13. lance_nd-0.1.0/lance_nd/__init__.py +32 -0
  14. lance_nd-0.1.0/lance_nd/_api.py +241 -0
  15. lance_nd-0.1.0/lance_nd/_chunks.py +48 -0
  16. lance_nd-0.1.0/lance_nd/_lance_nd.pyi +186 -0
  17. lance_nd-0.1.0/lance_nd/_typing.py +33 -0
  18. lance_nd-0.1.0/lance_nd/py.typed +0 -0
  19. lance_nd-0.1.0/pyproject.toml +53 -0
  20. lance_nd-0.1.0/python/Cargo.toml +23 -0
  21. lance_nd-0.1.0/python/README.md +62 -0
  22. lance_nd-0.1.0/python/src/lib.rs +649 -0
  23. lance_nd-0.1.0/python/tests/conftest.py +42 -0
  24. lance_nd-0.1.0/python/tests/test_api.py +392 -0
  25. lance_nd-0.1.0/python/tests/test_chunks.py +147 -0
  26. lance_nd-0.1.0/python/tests/test_native.py +85 -0
  27. lance_nd-0.1.0/python/tests/test_s3.py +46 -0
  28. lance_nd-0.1.0/python/tests/test_typing.py +64 -0
  29. lance_nd-0.1.0/python/tests/test_xarray.py +172 -0
  30. lance_nd-0.1.0/src/cast.rs +176 -0
  31. lance_nd-0.1.0/src/encode.rs +159 -0
  32. lance_nd-0.1.0/src/error.rs +75 -0
  33. lance_nd-0.1.0/src/format.rs +51 -0
  34. lance_nd-0.1.0/src/lib.rs +64 -0
  35. lance_nd-0.1.0/src/maintenance.rs +530 -0
  36. lance_nd-0.1.0/src/options.rs +309 -0
  37. lance_nd-0.1.0/src/prune.rs +232 -0
  38. lance_nd-0.1.0/src/scan.rs +263 -0
  39. lance_nd-0.1.0/src/schema.rs +357 -0
  40. lance_nd-0.1.0/src/stats.rs +445 -0
  41. lance_nd-0.1.0/src/store.rs +42 -0
  42. lance_nd-0.1.0/src/versions.rs +56 -0
  43. lance_nd-0.1.0/src/widen.rs +255 -0
  44. lance_nd-0.1.0/src/write.rs +220 -0
  45. lance_nd-0.1.0/src/writer.rs +625 -0
  46. lance_nd-0.1.0/tests/casting.rs +192 -0
  47. lance_nd-0.1.0/tests/dataset.rs +710 -0
  48. lance_nd-0.1.0/tests/lance_filter.rs +237 -0
  49. lance_nd-0.1.0/tests/maintenance.rs +262 -0
  50. lance_nd-0.1.0/tests/object_store.rs +223 -0
  51. lance_nd-0.1.0/tests/prune.rs +222 -0
  52. lance_nd-0.1.0/tests/prune_property.rs +180 -0
  53. lance_nd-0.1.0/tests/scale.rs +324 -0
  54. lance_nd-0.1.0/tests/staged_commit.rs +250 -0
  55. lance_nd-0.1.0/tests/stats.rs +671 -0
  56. lance_nd-0.1.0/tests/widen.rs +341 -0
  57. lance_nd-0.1.0/tests/writer.rs +877 -0
@@ -0,0 +1,104 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ # The release workflows run this first.
8
+ workflow_call:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ env:
14
+ CARGO_TERM_COLOR: always
15
+ # Each test binary links Lance. With debug info, they fill the runner disk.
16
+ CARGO_PROFILE_DEV_DEBUG: "0"
17
+ CARGO_PROFILE_TEST_DEBUG: "0"
18
+ PROTOC_VERSION: "29.3"
19
+
20
+ jobs:
21
+ lint:
22
+ runs-on: ubuntu-24.04
23
+ steps:
24
+ - uses: actions/checkout@v7
25
+ # Lance needs protoc to build.
26
+ - uses: taiki-e/install-action@v2
27
+ with:
28
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
29
+ - uses: dtolnay/rust-toolchain@stable
30
+ with:
31
+ components: rustfmt, clippy
32
+ - uses: Swatinem/rust-cache@v2
33
+ - run: cargo fmt --all --check
34
+ - run: cargo clippy --workspace --all-targets --all-features -- -D warnings
35
+ # Fails when a dependency is not on crates.io. The test jobs build the crate.
36
+ - run: cargo package -p lance-nd --no-verify
37
+
38
+ rust:
39
+ strategy:
40
+ fail-fast: false
41
+ matrix:
42
+ os: [ubuntu-24.04, macos-26, windows-latest]
43
+ runs-on: ${{ matrix.os }}
44
+ steps:
45
+ - uses: actions/checkout@v7
46
+ - uses: taiki-e/install-action@v2
47
+ with:
48
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
49
+ - uses: dtolnay/rust-toolchain@stable
50
+ - uses: Swatinem/rust-cache@v2
51
+ - run: cargo test --workspace
52
+
53
+ s3:
54
+ runs-on: ubuntu-24.04
55
+ env:
56
+ LANCE_ND_S3_ENDPOINT: http://127.0.0.1:5155
57
+ steps:
58
+ - uses: actions/checkout@v7
59
+ - uses: taiki-e/install-action@v2
60
+ with:
61
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
62
+ - uses: dtolnay/rust-toolchain@stable
63
+ - uses: Swatinem/rust-cache@v2
64
+ - uses: actions/setup-python@v7
65
+ with:
66
+ python-version: "3.12"
67
+ - name: Start an S3 server
68
+ run: |
69
+ python -m pip install "moto[server]"
70
+ nohup moto_server -H 127.0.0.1 -p 5155 > moto.log 2>&1 &
71
+ curl -s --retry 20 --retry-connrefused --retry-delay 1 -X PUT http://127.0.0.1:5155/lance-nd-test
72
+ - run: cargo test --features aws --test object_store
73
+
74
+ python:
75
+ runs-on: ubuntu-24.04
76
+ env:
77
+ LANCE_ND_S3_ENDPOINT: http://127.0.0.1:5155
78
+ steps:
79
+ - uses: actions/checkout@v7
80
+ - uses: taiki-e/install-action@v2
81
+ with:
82
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
83
+ - uses: dtolnay/rust-toolchain@stable
84
+ - uses: Swatinem/rust-cache@v2
85
+ - uses: actions/setup-python@v7
86
+ with:
87
+ python-version: "3.12"
88
+ - name: Start an S3 server
89
+ run: |
90
+ python -m pip install "moto[server]"
91
+ nohup moto_server -H 127.0.0.1 -p 5155 > moto.log 2>&1 &
92
+ curl -s --retry 20 --retry-connrefused --retry-delay 1 -X PUT http://127.0.0.1:5155/lance-nd-test
93
+ - name: Build and install the package
94
+ working-directory: python
95
+ run: |
96
+ python -m venv .venv
97
+ .venv/bin/python -m pip install maturin
98
+ VIRTUAL_ENV=$PWD/.venv .venv/bin/python -m maturin develop --release --extras dev
99
+ - name: Test
100
+ working-directory: python
101
+ run: .venv/bin/python -m pytest
102
+ - name: Type check
103
+ working-directory: python
104
+ run: .venv/bin/python -m mypy
@@ -0,0 +1,52 @@
1
+ name: Publish to crates.io
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ env:
12
+ PROTOC_VERSION: "29.3"
13
+
14
+ jobs:
15
+ ci:
16
+ uses: ./.github/workflows/ci.yml
17
+
18
+ semver:
19
+ needs: ci
20
+ runs-on: ubuntu-24.04
21
+ steps:
22
+ - uses: actions/checkout@v7
23
+ - uses: taiki-e/install-action@v2
24
+ with:
25
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
26
+ - id: published
27
+ run: |
28
+ if curl -sf -A "lance-nd release workflow" https://crates.io/api/v1/crates/lance-nd > /dev/null; then
29
+ echo "found=true" >> "$GITHUB_OUTPUT"
30
+ else
31
+ echo "found=false" >> "$GITHUB_OUTPUT"
32
+ fi
33
+ # The first release has no published version to compare with.
34
+ - if: steps.published.outputs.found == 'true'
35
+ uses: obi1kenobi/cargo-semver-checks-action@v2
36
+ with:
37
+ package: lance-nd
38
+
39
+ publish:
40
+ needs: [ci, semver]
41
+ runs-on: ubuntu-24.04
42
+ environment: crates-io
43
+ steps:
44
+ - uses: actions/checkout@v7
45
+ # Lance needs protoc to build.
46
+ - uses: taiki-e/install-action@v2
47
+ with:
48
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
49
+ - uses: dtolnay/rust-toolchain@stable
50
+ - run: cargo publish -p lance-nd
51
+ env:
52
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
@@ -0,0 +1,110 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ env:
12
+ PROTOC_VERSION: "29.3"
13
+
14
+ jobs:
15
+ ci:
16
+ uses: ./.github/workflows/ci.yml
17
+
18
+ linux:
19
+ strategy:
20
+ matrix:
21
+ include:
22
+ - runner: ubuntu-24.04
23
+ target: x86_64
24
+ protoc: linux-x86_64
25
+ - runner: ubuntu-24.04-arm
26
+ target: aarch64
27
+ protoc: linux-aarch_64
28
+ runs-on: ${{ matrix.runner }}
29
+ steps:
30
+ - uses: actions/checkout@v7
31
+ - uses: PyO3/maturin-action@v1
32
+ with:
33
+ working-directory: python
34
+ target: ${{ matrix.target }}
35
+ manylinux: "2_28"
36
+ args: --release --out dist
37
+ # Lance needs protoc to build.
38
+ before-script-linux: |
39
+ curl -sSL -o /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v${{ env.PROTOC_VERSION }}/protoc-${{ env.PROTOC_VERSION }}-${{ matrix.protoc }}.zip
40
+ python3 -m zipfile -e /tmp/protoc.zip /usr/local
41
+ chmod +x /usr/local/bin/protoc
42
+ - uses: actions/upload-artifact@v7
43
+ with:
44
+ name: wheels-linux-${{ matrix.target }}
45
+ path: python/dist
46
+
47
+ macos:
48
+ strategy:
49
+ matrix:
50
+ target: [x86_64, aarch64]
51
+ runs-on: macos-26
52
+ steps:
53
+ - uses: actions/checkout@v7
54
+ - uses: taiki-e/install-action@v2
55
+ with:
56
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
57
+ - uses: PyO3/maturin-action@v1
58
+ with:
59
+ working-directory: python
60
+ target: ${{ matrix.target }}
61
+ args: --release --out dist
62
+ - uses: actions/upload-artifact@v7
63
+ with:
64
+ name: wheels-macos-${{ matrix.target }}
65
+ path: python/dist
66
+
67
+ windows:
68
+ runs-on: windows-latest
69
+ steps:
70
+ - uses: actions/checkout@v7
71
+ - uses: taiki-e/install-action@v2
72
+ with:
73
+ tool: protoc@3.${{ env.PROTOC_VERSION }}
74
+ - uses: PyO3/maturin-action@v1
75
+ with:
76
+ working-directory: python
77
+ target: x64
78
+ args: --release --out dist
79
+ - uses: actions/upload-artifact@v7
80
+ with:
81
+ name: wheels-windows-x64
82
+ path: python/dist
83
+
84
+ sdist:
85
+ runs-on: ubuntu-24.04
86
+ steps:
87
+ - uses: actions/checkout@v7
88
+ - uses: PyO3/maturin-action@v1
89
+ with:
90
+ working-directory: python
91
+ command: sdist
92
+ args: --out dist
93
+ - uses: actions/upload-artifact@v7
94
+ with:
95
+ name: sdist
96
+ path: python/dist
97
+
98
+ publish:
99
+ needs: [ci, linux, macos, windows, sdist]
100
+ runs-on: ubuntu-24.04
101
+ environment: pypi
102
+ permissions:
103
+ # Trusted publishing gets a short-lived token from this OIDC id.
104
+ id-token: write
105
+ steps:
106
+ - uses: actions/download-artifact@v8
107
+ with:
108
+ path: dist
109
+ merge-multiple: true
110
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,44 @@
1
+ # Generated by Cargo
2
+ # will have compiled files and executables
3
+ debug
4
+ target
5
+
6
+ # These are backup files generated by rustfmt
7
+ **/*.rs.bk
8
+
9
+ # MSVC Windows builds of rustc generate these, which store debugging information
10
+ *.pdb
11
+
12
+ # Generated by cargo mutants
13
+ # Contains mutation testing data
14
+ **/mutants.out*/
15
+
16
+ # rustc will dump stack traces when hitting an internal compiler error to PWD
17
+ rustc-ice-*.txt
18
+
19
+ # RustRover
20
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
21
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
22
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
23
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
24
+ #.idea/
25
+ .superpowers/
26
+
27
+ # Python
28
+ .venv/
29
+ __pycache__/
30
+ *.pyd
31
+ *.so
32
+ .pytest_cache/
33
+
34
+ # Superpowers design docs
35
+ docs/superpowers/
36
+
37
+ # Local test data and scripts
38
+ testdata/
39
+
40
+ # Fuzz output
41
+ fuzz/target/
42
+ fuzz/artifacts/
43
+ fuzz/coverage/
44
+ fuzz/corpus/