Skip to content

Commit

Permalink
[BUG] Fix sync plugin files script to handle empty or non-existing cv…
Browse files Browse the repository at this point in the history
…s files

Signed-off-by: cindyyuanjiang <[email protected]>
  • Loading branch information
cindyyuanjiang authored Dec 5, 2024
1 parent 993bc8f commit a414e09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/sync_plugin_files/process_supported_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ def unify_all_files(root_dir, file_name, key_names):
for dir_name in os.listdir(root_dir): # List entries in root_dir
if os.path.isdir(os.path.join(root_dir, dir_name)):
csv_file_path = os.path.join(root_dir, dir_name, file_name)
cur_df = pd.read_csv(csv_file_path, keep_default_na=False)
try:
cur_df = pd.read_csv(csv_file_path, keep_default_na=False)
except Exception as e:
logging.debug(f"Encountered exception when reading file {csv_file_path}: {e}")
continue

if final_df.empty:
final_df = pd.DataFrame(columns=cur_df.columns.tolist())
Expand Down

0 comments on commit a414e09

Please sign in to comment.