rok commented on code in PR #55264:
URL: https://github.com/apache/arrow/pull/55264#discussion_r4525585663


##########
python/pyarrow-stubs/tests/test_types.py:
##########
@@ -0,0 +1,229 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# mypy: warn-unused-ignores
+
+from collections.abc import Hashable, Iterator
+from typing import TYPE_CHECKING, Literal
+
+import pyarrow.lib as lib
+import pyarrow.types as types
+from typing_extensions import CapsuleType
+
+from _check import TYPE_CHECKING_INVALID_USAGE, assert_type, check
+
+if TYPE_CHECKING:
+    # The stubs have a class per primitive type, but at runtime the
+    # factories return plain DataType instances, so these can only be
+    # referred to from type checking code.
+    from pyarrow.lib import (  # noqa: F401
+        BoolType,

Review Comment:
   Moved some of this into `python/pyarrow-stubs-tests/conftest.py`.
   
   I would either squash into `lib.pyi` (after reviewing) or add a mechanism 
later to squash `__lib.<module_name>.pyi` into `lib.pyi`at wheel build time and 
maybe development time too. Perhaps once we're done with annotations PR we 
squash `__lib.<module_name>.pyi` into `lib.pyi` with one PR?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to