You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/05/02 00:57:20 UTC

[GitHub] [iceberg] samredai commented on a diff in pull request #4678: Add a skeleton for the BuildPositionAccessors visitor

samredai commented on code in PR #4678:
URL: https://github.com/apache/iceberg/pull/4678#discussion_r862547388


##########
python/src/iceberg/schema.py:
##########
@@ -19,7 +19,10 @@
 
 import sys
 from abc import ABC, abstractmethod
-from typing import Dict, Generic, Iterable, List, TypeVar
+from typing import TYPE_CHECKING, Dict, Generic, Iterable, List, TypeVar
+
+if TYPE_CHECKING:
+    from iceberg.expressions.base import Accessor

Review Comment:
   `if TYPE_CHECKING` here is to avoid circular imports when using the class as a typehint (see docs [here](https://docs.python.org/3/library/typing.html#constant)). In summary, it's true when static type-checking is happening by mypy and false at runtime (avoiding any circular imports at runtime).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org