-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add datafusion-python #69
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ef6992c
Added Python project.
jorgecarleitao 91ab68e
Update python/Cargo.toml
jorgecarleitao 67f3279
Update python/Cargo.toml
jorgecarleitao 1ae4059
Added license and black formatting.
jorgecarleitao d85446e
License
jorgecarleitao 86186ea
Fixing build.
jorgecarleitao d471335
TesTestt
jorgecarleitao 8351836
Bumped to latest DataFusion.
jorgecarleitao 9c82552
Bumped nightly.
jorgecarleitao ab17019
Bumped pyarrow in tests.
jorgecarleitao 3d9e1a3
Added some tests back.
jorgecarleitao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| name: Build | ||
| on: | ||
| push: | ||
| tags: | ||
| - v* | ||
|
|
||
| jobs: | ||
| build-python-mac-win: | ||
| name: Mac/Win | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: [3.6, 3.7, 3.8] | ||
| os: [macos-latest, windows-latest] | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: nightly-2021-01-06 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install maturin | ||
|
|
||
| - name: Build Python package | ||
| run: cd python && maturin build --release --no-sdist --strip --interpreter python${{matrix.python_version}} | ||
|
|
||
| - name: List wheels | ||
| if: matrix.os == 'windows-latest' | ||
| run: dir python/target\wheels\ | ||
|
|
||
| - name: List wheels | ||
| if: matrix.os != 'windows-latest' | ||
| run: find ./python/target/wheels/ | ||
|
|
||
| - name: Archive wheels | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: dist | ||
| path: python/target/wheels/* | ||
|
|
||
| build-manylinux: | ||
| name: Manylinux | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Build wheels | ||
| run: docker run --rm -v $(pwd):/io konstin2/maturin build --release --manylinux | ||
| - name: Archive wheels | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: dist | ||
| path: python/target/wheels/* | ||
|
|
||
| release: | ||
| name: Publish in PyPI | ||
| needs: [build-manylinux, build-python-mac-win] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/download-artifact@v2 | ||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@master | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.pypi_password }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| name: Python test | ||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Setup Rust toolchain | ||
| run: | | ||
| rustup toolchain install nightly-2021-01-06 | ||
| rustup default nightly-2021-01-06 | ||
| rustup component add rustfmt | ||
| - name: Cache Cargo | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: /home/runner/.cargo | ||
| key: cargo-maturin-cache- | ||
| - name: Cache Rust dependencies | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: /home/runner/target | ||
| key: target-maturin-cache- | ||
| - uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: '3.7' | ||
| - name: Install Python dependencies | ||
| run: python -m pip install --upgrade pip setuptools wheel | ||
| - name: Run tests | ||
| run: | | ||
| cd python/ | ||
| export CARGO_HOME="/home/runner/.cargo" | ||
| export CARGO_TARGET_DIR="/home/runner/target" | ||
|
|
||
| python -m venv venv | ||
| source venv/bin/activate | ||
|
|
||
| pip install maturin==0.10.4 toml==0.10.1 pyarrow==4.0.0 | ||
| maturin develop | ||
|
|
||
| python -m unittest discover tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,4 +24,6 @@ members = [ | |
| "ballista/rust/core", | ||
| "ballista/rust/executor", | ||
| "ballista/rust/scheduler", | ||
| ] | ||
| ] | ||
|
|
||
| exclude = ["python"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| [target.x86_64-apple-darwin] | ||
| rustflags = [ | ||
| "-C", "link-arg=-undefined", | ||
| "-C", "link-arg=dynamic_lookup", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| target | ||
| venv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| /target | ||
| Cargo.lock | ||
| venv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| [package] | ||
| name = "datafusion" | ||
| version = "0.2.1" | ||
| homepage = "https://github.com/apache/arrow" | ||
| repository = "https://github.com/apache/arrow" | ||
| authors = ["Apache Arrow <dev@arrow.apache.org>"] | ||
| description = "Build and run queries against data" | ||
| readme = "README.md" | ||
| license = "Apache-2.0" | ||
| edition = "2018" | ||
|
|
||
| [dependencies] | ||
| tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"] } | ||
| rand = "0.7" | ||
| pyo3 = { version = "0.12.1", features = ["extension-module"] } | ||
| datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev = "2423ff0d" } | ||
|
|
||
| [lib] | ||
| name = "datafusion" | ||
| crate-type = ["cdylib"] | ||
|
|
||
| [package.metadata.maturin] | ||
| requires-dist = ["pyarrow>=1"] | ||
|
|
||
| classifier = [ | ||
| "Development Status :: 2 - Pre-Alpha", | ||
| "Intended Audience :: Developers", | ||
| "License :: OSI Approved :: Apache Software License", | ||
| "License :: OSI Approved", | ||
| "Operating System :: MacOS", | ||
| "Operating System :: Microsoft :: Windows", | ||
| "Operating System :: POSIX :: Linux", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.6", | ||
| "Programming Language :: Python :: 3.7", | ||
| "Programming Language :: Python :: 3.8", | ||
jorgecarleitao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Rust", | ||
| ] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag release probably won't work in the context of an ASF repo anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, we will need to work out a packaging; the build of the wheels is imo still relevant, as it is not so easy in Rust (afai understood support for this is still a bit WIP). Building the manylinux was a feat.