tadeja commented on code in PR #55592:
URL: https://github.com/apache/arrow/pull/55592#discussion_r4773172686


##########
python/scripts/run_stubtest.py:
##########
@@ -59,12 +59,22 @@ def main(argv):
     # and stubtest would check them as if they were stubs.
     with tempfile.TemporaryDirectory() as tmpdir, contextlib.chdir(tmpdir):
         os.symlink(STUBS_DIR, Path(tmpdir) / "pyarrow")
+        allowlists = ["--allowlist", str(ALLOWLIST)]
+        if sys.version_info < (3, 12):
+            # Classes that support the buffer protocol only have a __buffer__
+            # method from Python 3.12 on (PEP 688), while the stubs declare it
+            # for every version, like typeshed does. Unused entries fail
+            # stubtest, so this can't be in the allowlist file.
+            version_allowlist = Path(tmpdir) / "allowlist.txt"
+            version_allowlist.write_text(
+                r"pyarrow\.__lib\.[a-z]+\.[A-Za-z0-9_]+\.__buffer__" "\n")
+            allowlists += ["--allowlist", str(version_allowlist)]

Review Comment:
   well, I did add a note here to consider using 3.11 for a separate type 
checking CI job
   - https://github.com/apache/arrow/issues/55676#issuecomment-7219537379
   
   Do say if rather not 3.11 :)



-- 
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