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:47:43 UTC
[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #13658: ARROW-17142: [Python] Parquet FileMetadata.equals() method segfaults when passed None
jorisvandenbossche commented on code in PR #13658:
URL: https://github.com/apache/arrow/pull/13658#discussion_r925772233
##########
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:
> Finally, I think Cython already enforces the type due to the annotation above, so it's just that we need to check for None.
Indeed, and we can actually also let cython check for the None by changing the signature to `def equals(self, FileMetaData other not 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