Skip to content

Commit

Permalink
Merge branch 'main' into chore/contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
fpgmaas authored Jul 20, 2024
2 parents 0d34156 + f9f47db commit e37481c
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 106 deletions.
34 changes: 34 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Setup Python and Rust Environment"
description: "Set up Python, virtual environment, and Rust toolchain"

inputs:

python-version:
description: "The Python version to set up"
required: true
default: "3.10"

rust-toolchain:
description: "The Rust toolchain to set up"
required: true
default: "stable"

runs:
using: "composite"

steps:

- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: ${{ inputs.rust-toolchain }}
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
18 changes: 3 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Setup Environment
uses: ./.github/actions/setup-env

- name: Build and install deltalake
run: |
cd python
pip install virtualenv
virtualenv venv
python -m venv venv
source venv/bin/activate
make ${{ env.BUILD_ARGS }}
Expand Down
92 changes: 21 additions & 71 deletions .github/workflows/python_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Setup Environment
uses: ./.github/actions/setup-env

- name: Check Python
run: |
pip install ruff black mypy types-dataclasses typing-extensions
python -m venv venv
source venv/bin/activate
pip install ruff==0.5.2 mypy==1.10.1 types-dataclasses typing-extensions
make check-python
- name: Install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: stable
override: true

- name: Check Rust
run: make check-rust

Expand All @@ -45,24 +39,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python-version: 3.8

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Build and install deltalake
run: |
pip install virtualenv
virtualenv venv
python -m venv venv
source venv/bin/activate
make setup
# Install minimum PyArrow version
Expand All @@ -89,26 +73,15 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Setup Environment
uses: ./.github/actions/setup-env

- name: Start emulated services
run: docker-compose up -d

- name: Build and install deltalake
run: |
pip install virtualenv
virtualenv venv
python -m venv venv
source venv/bin/activate
make develop
Expand Down Expand Up @@ -137,23 +110,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup Environment
uses: ./.github/actions/setup-env

- name: Build deltalake in release mode
run: |
pip install virtualenv
virtualenv venv
python -m venv venv
source venv/bin/activate
MATURIN_EXTRA_ARGS=--release make develop
Expand Down Expand Up @@ -187,18 +149,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Setup Environment
uses: ./.github/actions/setup-env

- uses: actions/setup-java@v2
with:
Expand All @@ -207,8 +159,7 @@ jobs:

- name: Build and install deltalake
run: |
pip install virtualenv
virtualenv venv
python -m venv venv
source venv/bin/activate
make develop-pyspark
Expand All @@ -231,15 +182,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Setup Environment
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}

- name: Build and install deltalake
run: |
pip install virtualenv
virtualenv venv
python -m venv venv
source venv/bin/activate
make setup
maturin develop
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ __blobstorage__
.githubchangeloggenerator.cache.log
.githubchangeloggenerator.cache/
.githubchangeloggenerator*
data

# Add all Cargo.lock files except for those in binary crates
Cargo.lock
Expand All @@ -31,4 +32,4 @@ Cargo.lock

justfile
site
__pycache__
__pycache__
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ debug = true
debug = "line-tables-only"

[workspace.dependencies]
delta_kernel = { version = "0.1.1" }
delta_kernel = { version = "0.2.0" }
# delta_kernel = { path = "../delta-kernel-rs/kernel" }

# arrow
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<img alt="#delta-rs in the Delta Lake Slack workspace" src="https://img.shields.io/badge/slack-delta-blue.svg?logo=slack&style=flat-square&color=F75101">
</a>
</p>
Delta Lake is an open-source storage format that runs on top of existing data lakes. Delta Lake is compatible with processing engines like Apache Spark and provides benefits such as ACID transaction guarantees, schema enforcement, and scalable data handling.

The Delta Lake project aims to unlock the power of the Deltalake for as many users and projects as possible
by providing native low-level APIs aimed at developers and integrators, as well as a high-level operations
Expand Down
3 changes: 1 addition & 2 deletions crates/core/src/kernel/arrow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,7 @@ fn max_min_schema_for_fields(dest: &mut Vec<ArrowField>, f: &ArrowField) {
// don't compute min or max for list, map or binary types
ArrowDataType::List(_) | ArrowDataType::Map(_, _) | ArrowDataType::Binary => { /* noop */ }
_ => {
let f = f.clone();
dest.push(f);
dest.push(ArrowField::new(f.name(), f.data_type().clone(), true));
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ format: ## Format the code
$(info --- Rust format ---)
cargo fmt
$(info --- Python format ---)
ruff . --fix
ruff check . --fix
ruff format .

.PHONY: check-rust
Expand All @@ -77,6 +77,11 @@ unit-test: ## Run unit test
$(info --- Run Python unit-test ---)
python -m pytest --doctest-modules

.PHONY: test-cov
test-cov: ## Create coverage report
$(info --- Run Python unit-test ---)
python -m pytest --doctest-modules --cov --cov-config=pyproject.toml --cov-report=term --cov-report=html

.PHONY: test-pyspark
test-pyspark:
python -m pytest -m 'pyspark and integration'
Expand Down
2 changes: 1 addition & 1 deletion python/deltalake/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from deltalake.schema import Schema as DeltaSchema

try:
import pandas as pd # noqa: F811
import pandas as pd
except ModuleNotFoundError:
_has_pandas = False
else:
Expand Down
Loading

0 comments on commit e37481c

Please sign in to comment.