You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2022/08/28 22:16:21 UTC

[iceberg] branch master updated: Python: Add annotations typedef (#5628)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 509b817ebc Python: Add annotations typedef (#5628)
509b817ebc is described below

commit 509b817ebcdf582d5f515d824e37e5dcce626def
Author: Fokko Driesprong <fo...@apache.org>
AuthorDate: Mon Aug 29 00:16:15 2022 +0200

    Python: Add annotations typedef (#5628)
---
 python/pyiceberg/typedef.py  | 4 ++--
 python/tests/test_typedef.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/pyiceberg/typedef.py b/python/pyiceberg/typedef.py
index dc95702813..ad62fbb4ad 100644
--- a/python/pyiceberg/typedef.py
+++ b/python/pyiceberg/typedef.py
@@ -23,8 +23,8 @@ from typing import (
 )
 
 
-class FrozenDict(Dict):
-    def __setitem__(self, instance, value):
+class FrozenDict(Dict[Any, Any]):
+    def __setitem__(self, instance: Any, value: Any) -> None:
         raise AttributeError("FrozenDict does not support assignment")
 
     def update(self, *args: Any, **kwargs: Any) -> None:
diff --git a/python/tests/test_typedef.py b/python/tests/test_typedef.py
index 24a98dfeb8..01eed9cde0 100644
--- a/python/tests/test_typedef.py
+++ b/python/tests/test_typedef.py
@@ -19,13 +19,13 @@ import pytest
 from pyiceberg.typedef import FrozenDict
 
 
-def test_setitem_frozendict():
+def test_setitem_frozendict() -> None:
     d = FrozenDict(foo=1, bar=2)
     with pytest.raises(AttributeError):
         d["foo"] = 3
 
 
-def test_update_frozendict():
+def test_update_frozendict() -> None:
     d = FrozenDict(foo=1, bar=2)
     with pytest.raises(AttributeError):
         d.update({"yes": 2})