Skip to content

Commit 8849d97

Browse files
committed
Merge branch 'main' of github.com:apache/iceberg-python into fd-add-ability-to-delete-full-data-files
2 parents d65a8a4 + da313d0 commit 8849d97

File tree

9 files changed

+234
-245
lines changed

9 files changed

+234
-245
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,14 @@ repos:
7575
# --line-length is set to a high value to deal with very long lines
7676
- --line-length
7777
- '99999'
78+
ci:
79+
autofix_commit_msg: |
80+
[pre-commit.ci] auto fixes from pre-commit.com hooks
81+
82+
for more information, see https://pre-commit.ci
83+
autofix_prs: true
84+
autoupdate_branch: ''
85+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
86+
autoupdate_schedule: weekly
87+
skip: []
88+
submodules: false

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
install-poetry:
19-
pip install poetry==1.7.1
19+
pip install poetry==1.8.2
2020

2121
install-dependencies:
2222
poetry install -E pyarrow -E hive -E s3fs -E glue -E adlfs -E duckdb -E ray -E sql-postgres -E gcsfs -E sql-sqlite -E daft

mkdocs/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
mkdocs==1.5.3
19-
griffe==0.40.1
18+
mkdocs==1.6.0
19+
griffe==0.44.0
2020
jinja2==3.1.3
21-
mkdocstrings==0.24.0
22-
mkdocstrings-python==1.8.0
21+
mkdocstrings==0.25.0
22+
mkdocstrings-python==1.10.0
2323
mkdocs-literate-nav==0.6.1
24-
mkdocs-autorefs==0.5.0
24+
mkdocs-autorefs==1.0.1
2525
mkdocs-gen-files==0.5.0
26-
mkdocs-material==9.5.18
26+
mkdocs-material==9.5.20
2727
mkdocs-material-extensions==1.3.1
2828
mkdocs-section-index==0.3.8

poetry.lock

Lines changed: 197 additions & 228 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyiceberg/io/pyarrow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class PyArrowFile(InputFile, OutputFile):
206206
>>> # output_file.create().write(b'foobytes')
207207
"""
208208

209-
_fs: FileSystem
209+
_filesystem: FileSystem
210210
_path: str
211211
_buffer_size: int
212212

@@ -333,7 +333,7 @@ def parse_location(location: str) -> Tuple[str, str, str]:
333333
if not uri.scheme:
334334
return "file", uri.netloc, os.path.abspath(location)
335335
elif uri.scheme == "hdfs":
336-
return uri.scheme, uri.netloc, location
336+
return uri.scheme, uri.netloc, uri.path
337337
else:
338338
return uri.scheme, uri.netloc, f"{uri.netloc}{uri.path}"
339339

pyiceberg/utils/decimal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def bytes_required(value: Union[int, Decimal]) -> int:
5959
int: the minimum number of bytes needed to serialize the value.
6060
"""
6161
if isinstance(value, int):
62-
return (value.bit_length() + 7) // 8
62+
return (value.bit_length() + 8) // 8
6363
elif isinstance(value, Decimal):
64-
return (decimal_to_unscaled(value).bit_length() + 7) // 8
64+
return (decimal_to_unscaled(value).bit_length() + 8) // 8
6565

6666
raise ValueError(f"Unsupported value: {value}")
6767

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fsspec = ">=2023.1.0,<2025.1.0"
5858
pyparsing = ">=3.1.0,<4.0.0"
5959
zstandard = ">=0.13.0,<1.0.0"
6060
tenacity = ">=8.2.3,<9.0.0"
61-
pyarrow = { version = ">=9.0.0,<16.0.0", optional = true }
61+
pyarrow = { version = ">=9.0.0,<17.0.0", optional = true }
6262
pandas = { version = ">=1.0.0,<3.0.0", optional = true }
6363
duckdb = { version = ">=0.5.0,<1.0.0", optional = true }
6464
ray = { version = ">=2.0.0,<2.10.0", optional = true }
@@ -84,7 +84,7 @@ requests-mock = "1.12.1"
8484
moto = { version = "^5.0.2", extras = ["server"] }
8585
typing-extensions = "4.11.0"
8686
pytest-mock = "3.14.0"
87-
pyspark = "3.5.0"
87+
pyspark = "3.5.1"
8888
cython = "3.0.8"
8989
deptry = ">=0.14,<0.17"
9090
docutils = "!=0.21"

tests/io/test_pyarrow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,9 +1644,9 @@ def check_results(location: str, expected_schema: str, expected_netloc: str, exp
16441644
assert netloc == expected_netloc
16451645
assert uri == expected_uri
16461646

1647-
check_results("hdfs://127.0.0.1:9000/root/foo.txt", "hdfs", "127.0.0.1:9000", "hdfs://127.0.0.1:9000/root/foo.txt")
1648-
check_results("hdfs://127.0.0.1/root/foo.txt", "hdfs", "127.0.0.1", "hdfs://127.0.0.1/root/foo.txt")
1649-
check_results("hdfs://clusterA/root/foo.txt", "hdfs", "clusterA", "hdfs://clusterA/root/foo.txt")
1647+
check_results("hdfs://127.0.0.1:9000/root/foo.txt", "hdfs", "127.0.0.1:9000", "/root/foo.txt")
1648+
check_results("hdfs://127.0.0.1/root/foo.txt", "hdfs", "127.0.0.1", "/root/foo.txt")
1649+
check_results("hdfs://clusterA/root/foo.txt", "hdfs", "clusterA", "/root/foo.txt")
16501650

16511651
check_results("/root/foo.txt", "file", "", "/root/foo.txt")
16521652
check_results("/root/tmp/foo.txt", "file", "", "/root/tmp/foo.txt")

tests/utils/test_decimal.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
from decimal import Decimal
18+
1719
import pytest
1820

19-
from pyiceberg.utils.decimal import decimal_required_bytes
21+
from pyiceberg.utils.decimal import decimal_required_bytes, decimal_to_bytes
2022

2123

2224
def test_decimal_required_bytes() -> None:
@@ -38,3 +40,10 @@ def test_decimal_required_bytes() -> None:
3840
with pytest.raises(ValueError) as exc_info:
3941
decimal_required_bytes(precision=-1)
4042
assert "(0, 40]" in str(exc_info.value)
43+
44+
45+
def test_decimal_to_bytes() -> None:
46+
# Check the boundary between 2 and 3 bytes.
47+
# 2 bytes has a minimum of -32,768 and a maximum value of 32,767 (inclusive).
48+
assert decimal_to_bytes(Decimal('32767.')) == b'\x7f\xff'
49+
assert decimal_to_bytes(Decimal('32768.')) == b'\x00\x80\x00'

0 commit comments

Comments
 (0)