jorisvandenbossche commented on pull request #10054:
URL: https://github.com/apache/arrow/pull/10054#issuecomment-826926941


   Personally, I still find it worth it to provide a better error message. Yes, 
it's not typical to pass `None` as the file source, but it can accidentally 
happen, and then the current message is not that helpful (it doesn't give any 
indication which is incorrectly being passed as None, but just showing a later 
error about None not having some attribute)
   
   For example adding a simple `not None` to ParquetReader:
   
   ```diff
   --- a/python/pyarrow/_parquet.pyx
   +++ b/python/pyarrow/_parquet.pyx
   @@ -927,7 +927,7 @@ cdef class ParquetReader(_Weakrefable):
            self.pool = maybe_unbox_memory_pool(memory_pool)
            self._metadata = None
    
   -    def open(self, object source, bint use_memory_map=True,
   +    def open(self, object source not None, bint use_memory_map=True,
                 read_dictionary=None, FileMetaData metadata=None,
                 int buffer_size=0):
   ```
   
   could also help if we don't want to add an explicit `if .. is None: ..` 
check.


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

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


Reply via email to