diff --git a/python/Cargo.toml b/python/Cargo.toml index b4dcef4697..0a7e5d1b99 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deltalake-python" -version = "0.5.3" +version = "0.5.4" authors = ["Qingping Hou "] homepage = "https://github.com/delta-io/delta-rs" license = "Apache-2.0" diff --git a/python/deltalake/__init__.py b/python/deltalake/__init__.py index 513804fce1..aeb999c97a 100644 --- a/python/deltalake/__init__.py +++ b/python/deltalake/__init__.py @@ -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 diff --git a/python/deltalake/fs.py b/python/deltalake/fs.py index f5a4555630..21e27a018c 100644 --- a/python/deltalake/fs.py +++ b/python/deltalake/fs.py @@ -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. """ diff --git a/python/pyproject.toml b/python/pyproject.toml index f1a9b0574b..2b65ca48e0 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -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\"')", ] \ No newline at end of file diff --git a/python/src/lib.rs b/python/src/lib.rs index 31c978a833..d50d4a3ba1 100644 --- a/python/src/lib.rs +++ b/python/src/lib.rs @@ -284,6 +284,6 @@ fn deltalake(py: Python, m: &PyModule) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; - m.add("DeltaTableError", py.get_type::())?; + m.add("PyDeltaTableError", py.get_type::())?; Ok(()) } diff --git a/python/stubs/deltalake/deltalake.pyi b/python/stubs/deltalake/deltalake.pyi index 0023b285b3..f420569e5d 100644 --- a/python/stubs/deltalake/deltalake.pyi +++ b/python/stubs/deltalake/deltalake.pyi @@ -1,5 +1,6 @@ from typing import Any, Callable RawDeltaTable: Any +PyDeltaTableError: Any rust_core_version: Callable[[], str] DeltaStorageFsBackend: Any diff --git a/python/tests/test_table_read.py b/python/tests/test_table_read.py index e708008f19..8415d8697f 100644 --- a/python/tests/test_table_read.py +++ b/python/tests/test_table_read.py @@ -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."""