pitrou commented on code in PR #45629: URL: https://github.com/apache/arrow/pull/45629#discussion_r1989134951
########## cpp/src/arrow/util/bpacking64_codegen.py: ########## @@ -73,55 +73,52 @@ def howmanybytes(bit): print("inline const uint8_t* unpack0_64(const uint8_t* in, uint64_t* out) {") -print(" for(int k = 0; k < {0} ; k += 1) {{".format(howmany(0))) +print(f" for(int k = 0; k < {howmany(0)} ; k += 1) {{{{") Review Comment: Did you check that this script still runs fine according to the instructions above? ########## python/pyarrow/device.pxi: ########## @@ -137,9 +137,7 @@ cdef class MemoryManager(_Weakrefable): return self.memory_manager def __repr__(self): - return "<pyarrow.MemoryManager device: {}>".format( - frombytes(self.memory_manager.get().device().get().ToString()) - ) + return f"<pyarrow.MemoryManager device: {frombytes(self.memory_manager.get().device().get().ToString())}>" Review Comment: This line is a bit too long, perhaps use a temporary variable? ########## python/pyarrow/feather.py: ########## @@ -69,10 +69,8 @@ def read_table(self, columns=None): def validate_schemas(self, piece, table): if not self.schema.equals(table.schema): - raise ValueError('Schema in {!s} was different. \n' - '{!s}\n\nvs\n\n{!s}' - .format(piece, self.schema, - table.schema)) + raise ValueError(f'Schema in {piece!s} was different. \n' + f'{self.schema!s}\n\nvs\n\n{table.schema!s}') Review Comment: I think `!s` is generally implicit. ########## python/pyarrow/pandas_compat.py: ########## @@ -621,13 +620,12 @@ def convert_column(col, field): except (pa.ArrowInvalid, pa.ArrowNotImplementedError, pa.ArrowTypeError) as e: - e.args += ("Conversion failed for column {!s} with type {!s}" - .format(col.name, col.dtype),) + e.args += ( + f"Conversion failed for column {col.name!s} with type {col.dtype!s}",) Review Comment: Same here: `!s` is probably unnecessary. -- 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