This is an automated email from the ASF dual-hosted git repository.

blue pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git


The following commit(s) were added to refs/heads/main by this push:
     new 3dd6776  Build: Add flake8-pie to ruff (#86)
3dd6776 is described below

commit 3dd6776fc4d022468bd8194706d3e4bd98be85e1
Author: Fokko Driesprong <[email protected]>
AuthorDate: Sun Nov 5 19:15:54 2023 +0100

    Build: Add flake8-pie to ruff (#86)
---
 pyiceberg/io/pyarrow.py   |  2 +-
 pyproject.toml            |  1 +
 tests/test_integration.py | 12 +++---------
 tests/test_types.py       |  2 +-
 4 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py
index 75049d8..67a16eb 100644
--- a/pyiceberg/io/pyarrow.py
+++ b/pyiceberg/io/pyarrow.py
@@ -1508,7 +1508,7 @@ def fill_parquet_file_metadata(
 
         invalidate_col: Set[int] = set()
 
-        for pos in range(0, parquet_metadata.num_columns):
+        for pos in range(parquet_metadata.num_columns):
             column = row_group.column(pos)
             field_id = parquet_column_mapping[column.path_in_schema]
 
diff --git a/pyproject.toml b/pyproject.toml
index 4559590..b1a9dfc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -298,6 +298,7 @@ select = [
     "W", # pycodestyle
     "F", # Pyflakes
     "B", # flake8-bugbear
+    "PIE", # flake8-pie
     "C4", # flake8-comprehensions
     "I", # isort
     "UP", # pyupgrade
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 4683aa8..6e1c071 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -121,7 +121,7 @@ def test_table_properties(table: Table) -> None:
     with table.transaction() as transaction:
         transaction.set_properties(abc="🤪")
 
-    assert table.properties == dict(**{"abc": "🤪"}, **DEFAULT_PROPERTIES)
+    assert table.properties == dict(abc="🤪", **DEFAULT_PROPERTIES)
 
     with table.transaction() as transaction:
         transaction.remove_properties("abc")
@@ -130,7 +130,7 @@ def test_table_properties(table: Table) -> None:
 
     table = table.transaction().set_properties(abc="def").commit_transaction()
 
-    assert table.properties == dict(**{"abc": "def"}, **DEFAULT_PROPERTIES)
+    assert table.properties == dict(abc="def", **DEFAULT_PROPERTIES)
 
     table = table.transaction().remove_properties("abc").commit_transaction()
 
@@ -229,13 +229,7 @@ def test_ray_all_types(table_test_all_types: Table) -> 
None:
 
 @pytest.mark.integration
 def test_pyarrow_to_iceberg_all_types(table_test_all_types: Table) -> None:
-    fs = S3FileSystem(
-        **{
-            "endpoint_override": "http://localhost:9000";,
-            "access_key": "admin",
-            "secret_key": "password",
-        }
-    )
+    fs = S3FileSystem(endpoint_override="http://localhost:9000";, 
access_key="admin", secret_key="password")
     data_file_paths = [task.file.file_path for task in 
table_test_all_types.scan().plan_files()]
     for data_file_path in data_file_paths:
         uri = urlparse(data_file_path)
diff --git a/tests/test_types.py b/tests/test_types.py
index 6aed56c..38922f7 100644
--- a/tests/test_types.py
+++ b/tests/test_types.py
@@ -496,7 +496,7 @@ def test_repr_nestedfield() -> None:
 def test_nestedfield_by_alias() -> None:
     # We should be able to initialize a NestedField by alias
     expected = NestedField(1, "required_field", StringType(), True, "this is a 
doc")
-    actual = NestedField(**{"id": 1, "name": "required_field", "type": 
"string", "required": True, "doc": "this is a doc"})  # type: ignore
+    actual = NestedField(id=1, name="required_field", type="string", 
required=True, doc="this is a doc")
     assert expected == actual
 
 

Reply via email to