peter-toth commented on code in PR #60561:
URL: https://github.com/apache/spark/pull/60561#discussion_r4589259595
##########
dev/structured_logging_style.py:
##########
@@ -41,7 +41,9 @@ def main():
nonmigrated_files = {}
- scala_files = glob.glob(os.path.join(__file__, "../", "**", "*.scala"),
recursive=True)
+ # Scan the Scala files under the repository root regardless of the current
working directory.
+ os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
+ scala_files = glob.glob(os.path.join("**", "*.scala"), recursive=True)
Review Comment:
**Finding 1.** With no files to scan, `nonmigrated_files` stays empty, so
`all(...)` is `True` and the script reports success. That is how #51087 turned
the check off without anyone noticing. Failing on an empty file list makes the
next path mistake break CI instead. I tried this guard on an empty tree (exit
255) and on the PR base (it still scans and reports the 49).
```suggestion
scala_files = glob.glob(os.path.join("**", "*.scala"), recursive=True)
if not scala_files:
print("[error] Found no Scala files to check.", file=sys.stderr)
sys.exit(-1)
```
##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/State.scala:
##########
@@ -86,8 +86,9 @@ object State extends Logging {
flow match {
case f if flowMetadata.latestCheckpointLocationOpt().isEmpty =>
logInfo(
- s"Skipping resetting flow ${f.identifier} since its destination not
been previously" +
- s"materialized and we can't find the checkpoint location."
+ log"Skipping resetting flow ${MDC(LogKeys.FLOW_NAME, f.identifier)}
since its " +
+ log"destination not been previously" +
+ log"materialized and we can't find the checkpoint location."
Review Comment:
**Finding 2.** `"previously" + "materialized"` prints
`previouslymaterialized`. The bug is older than this PR, but these lines are
rewrapped here anyway. The sentence is also missing "has".
```suggestion
log"destination has not been previously materialized and we can't
find the " +
log"checkpoint location."
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]