gemini-code-assist[bot] commented on code in PR #38367:
URL: https://github.com/apache/beam/pull/38367#discussion_r3185176391
##########
sdks/python/apache_beam/yaml/yaml_transform_test.py:
##########
@@ -286,9 +277,14 @@ def test_csv_to_json(self):
num_shards: 1
- type: LogForTesting
''' % (repr(input), repr(output)))
- all_output = list(glob.glob(output + "*"))
- self.assertEqual(len(all_output), 1)
- output_shard = list(glob.glob(output + "*"))[0]
+ all_output = list(glob.glob(output + "-*"))
+ file_and_size = {f: os.path.getsize(f) for f in all_output}
+ self.assertEqual(
+ len(all_output),
+ 1,
+ msg=f"Expected 1 shard file, but found {len(all_output)}. \
+ Files & sizes (bytes): {file_and_size}")
Review Comment:

Using a backslash for line continuation in strings is discouraged by PEP 8
as it can lead to unexpected whitespace in the resulting string. In this case,
the indentation on the second line will be included as literal spaces in the
assertion message. Since this call is already within parentheses, you can use
implicit string concatenation, which is cleaner and avoids the formatting issue.
```suggestion
msg=f"Expected 1 shard file, but found {len(all_output)}. "
f"Files & sizes (bytes): {file_and_size}")
```
<details>
<summary>References</summary>
1. PEP 8 recommends using Python's implied line continuation inside
parentheses, brackets, and braces for wrapping long lines, rather than using a
backslash for string continuation.
<sup>([link](http://console.cloud.google.com/gemini-code-assist/agents-tools))</sup>
</details>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]