This is an automated email from the ASF dual-hosted git repository.

yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 00bf1c6d036 Change orphan file log to warning (#31835)
00bf1c6d036 is described below

commit 00bf1c6d03614624480646e32145e183d3042ee6
Author: Yi Hu <[email protected]>
AuthorDate: Wed Jul 10 20:59:25 2024 -0400

    Change orphan file log to warning (#31835)
---
 sdks/python/apache_beam/io/fileio.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sdks/python/apache_beam/io/fileio.py 
b/sdks/python/apache_beam/io/fileio.py
index a90ba3a50e7..378ecf71920 100644
--- a/sdks/python/apache_beam/io/fileio.py
+++ b/sdks/python/apache_beam/io/fileio.py
@@ -90,7 +90,6 @@ parameter can be anything, as long as elements can be grouped 
by it.
 
 import collections
 import logging
-import os
 import random
 import uuid
 from collections import namedtuple
@@ -702,9 +701,10 @@ class _MoveTempFilesIntoFinalDestinationFn(beam.DoFn):
 
     move_from = [f.file_name for f in temp_file_results]
     move_to = [f.file_name for f in final_file_results]
+
     _LOGGER.info(
-        'Moving temporary files %s to dir: %s as %s',
-        map(os.path.basename, move_from),
+        'Moving %d temporary files to dir: %s as %s',
+        len(move_from),
         self.path.get(),
         move_to)
 
@@ -745,13 +745,13 @@ class _MoveTempFilesIntoFinalDestinationFn(beam.DoFn):
       orphaned_files = [m.path for m in match_result[0].metadata_list]
 
       if len(orphaned_files) > 0:
-        _LOGGER.info(
+        _LOGGER.warning(
             'Some files may be left orphaned in the temporary folder: %s. '
-            'This may be a result of insufficient permissions to delete'
-            'these temp files.',
+            'This may be a result of retried work items or insufficient'
+            'permissions to delete these temp files.',
             orphaned_files)
     except BeamIOError as e:
-      _LOGGER.info('Exceptions when checking orphaned files: %s', e)
+      _LOGGER.warning('Exceptions when checking orphaned files: %s', e)
 
 
 class _WriteShardedRecordsFn(beam.DoFn):

Reply via email to