diff --git a/python/deltalake/writer/writer.py b/python/deltalake/writer/writer.py index ec888d9209..4295fd52b1 100644 --- a/python/deltalake/writer/writer.py +++ b/python/deltalake/writer/writer.py @@ -97,7 +97,7 @@ def write_deltalake( configuration: A map containing configuration options for the metadata action. schema_mode: If set to "overwrite", allows replacing the schema of the table. Set to "merge" to merge with existing schema. storage_options: options passed to the native delta filesystem. - predicate: When using `Overwrite` mode, replace data that matches a predicate. Only used in rust engine.' + predicate: When using `Overwrite` mode, replace data that matches a predicate.' target_file_size: Override for target file size for data files written to the delta table. If not passed, it's taken from `delta.targetFileSize`. writer_properties: Pass writer properties to the Rust parquet writer. post_commithook_properties: properties for the post commit hook. If None, default values are used. diff --git a/python/pyproject.toml b/python/pyproject.toml index 83b1a057d1..91ec433fc3 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -70,7 +70,7 @@ ignore = ["E501", "ANN401", "RUF040"] known-first-party = ["deltalake"] [tool.pytest.ini_options] -addopts = "-v -m 'not integration and not benchmark and not no_pyarrow'" +addopts = "-v -x -m 'not integration and not benchmark and not no_pyarrow'" testpaths = ["tests", "deltalake"] markers = [ "integration: marks tests as integration tests (deselect with '-m \"not integration\"')", diff --git a/python/tests/test_writer.py b/python/tests/test_writer.py index 6ebdff1251..cff8e01015 100644 --- a/python/tests/test_writer.py +++ b/python/tests/test_writer.py @@ -2510,3 +2510,49 @@ def test_tilde_path_works_with_writes(): expanded_path = os.path.expanduser(tilde_path) if os.path.exists(expanded_path): shutil.rmtree(expanded_path) + + +@pytest.mark.pyarrow +def test_dots_in_column_names_2624(tmp_path: pathlib.Path): + """ + + """ + import pyarrow as pa + initial = pa.Table.from_pydict( + { + "Product.Id": ['x-0', 'x-1', 'x-2', 'x-3'], + 'Cost' : [10, 11, 12, 13], + } + ) + + write_deltalake( + table_or_uri=tmp_path, + data=initial, + partition_by=["Product.Id"], + ) + + update = pa.Table.from_pydict( + { + "Product.Id": ['x-1'], + 'Cost' : [101], + } + ) + + write_deltalake( + table_or_uri=tmp_path, + data=update, + partition_by=["Product.Id"], + mode="overwrite", + predicate="\"Product.Id\" = 'x-1'" + ) + + dt = DeltaTable(tmp_path) + expected = pa.Table.from_pydict( + { + "Product.Id": ['x-0', 'x-1', 'x-2', 'x-3'], + 'Cost' : [10, 101, 12, 13], + } + ) + # Sorting just to make sure the equivalency matches up + actual = dt.to_pyarrow_table().sort_by('Product.Id') + assert expected == actual