You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/20 15:41:27 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #13658: ARROW-17142: [Python] Parquet FileMetadata.equals() method segfaults when passed None

lidavidm commented on code in PR #13658:
URL: https://github.com/apache/arrow/pull/13658#discussion_r925764814


##########
python/pyarrow/_parquet.pyx:
##########
@@ -680,6 +680,9 @@ cdef class FileMetaData(_Weakrefable):
         -------
         are_equal : bool
         """
+        err_msg = lambda: ("Expected `other` to be of type FileMetaData"
+                           " but found " + str(type(other)))

Review Comment:
   Why not just `if not isinstance…` and a regular `raise`? (assertions can technically be disabled.) And the idiomatic exception would be TypeError.
   
   Finally, I think Cython already enforces the type due to the annotation above, so it's just that we need to check for None.



-- 
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: github-unsubscribe@arrow.apache.org

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