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

Add DeltaTableError in Python binding #496

Merged
merged 1 commit into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deltalake-python"
version = "0.5.3"
version = "0.5.4"
authors = ["Qingping Hou <dave2008713@gmail.com>"]
homepage = "https://github.com/delta-io/delta-rs"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion python/deltalake/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .data_catalog import DataCatalog
from .deltalake import RawDeltaTable, rust_core_version
from .deltalake import PyDeltaTableError, RawDeltaTable, rust_core_version
from .schema import DataType, Field, Schema
from .table import DeltaTable, Metadata
2 changes: 1 addition & 1 deletion python/deltalake/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def create_dir(self, path: str, *, recursive: bool = True) -> None:
Create a directory and subdirectories.

This function succeeds if the directory already exists.

:param path: The path of the new directory.
:param recursive: Create nested directories as well.
"""
Expand Down
4 changes: 4 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ exclude = "venv"
addopts = "--cov=deltalake -v -m 'not integration'"
testpaths = [
"tests",
]
markers = [
"integration: marks tests as integration tests (deselect with '-m \"not integration\"')",
"s3: marks tests as integration tests with S3 (deselect with '-m \"not s3\"')",
]
2 changes: 1 addition & 1 deletion python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,6 @@ fn deltalake(py: Python, m: &PyModule) -> PyResult<()> {
m.add_class::<RawDeltaTable>()?;
m.add_class::<RawDeltaTableMetaData>()?;
m.add_class::<DeltaStorageFsBackend>()?;
m.add("DeltaTableError", py.get_type::<PyDeltaTableError>())?;
m.add("PyDeltaTableError", py.get_type::<PyDeltaTableError>())?;
Ok(())
}
1 change: 1 addition & 0 deletions python/stubs/deltalake/deltalake.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Any, Callable

RawDeltaTable: Any
PyDeltaTableError: Any
rust_core_version: Callable[[], str]
DeltaStorageFsBackend: Any
6 changes: 6 additions & 0 deletions python/tests/test_table_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ def test_delta_table_with_filesystem():
assert dt.to_pandas(filesystem=filesystem).equals(pd.DataFrame({"id": [5, 7, 9]}))


def test_import_delta_table_error():
from deltalake import PyDeltaTableError

PyDeltaTableError()


class ExcPassThroughThread(Thread):
"""Wrapper around `threading.Thread` that propagates exceptions."""

Expand Down