EnricoMi commented on code in PR #43537: URL: https://github.com/apache/arrow/pull/43537#discussion_r1706677572
########## python/pyarrow/_flight.pyx: ########## @@ -855,10 +888,14 @@ cdef class FlightInfo(_Weakrefable): the descriptor for this flight. endpoints : list of FlightEndpoint a list of endpoints where this flight is available. - total_records : int - the total records in this flight, or -1 if unknown - total_bytes : int - the total bytes in this flight, or -1 if unknown + total_records : int optional, default -1 + the total records in this flight, or -1 if unknown. + total_bytes : int optional, default -1 + the total bytes in this flight, or -1 if unknown. Review Comment: This does not affect the underlying structure. The Python `FlightEnpoint` can take `None` values and translate to `-1` for the underlying C++ class. The getter methods can translate those `-1` back to `None`, so this Python class feels pythonic. Using `-1` in constructor would continue to work while getters would return `None`. User code like `if endpoint.total_records == -1` would break. This would have to be migrated to `if endpoint.total_records is None`, which is for the better, as @pitrou phrased it. -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org