Skip to content

Commit

Permalink
small updates to reporting and exit when incomplete file
Browse files Browse the repository at this point in the history
  • Loading branch information
threnjen committed Nov 25, 2024
1 parent a79763d commit f58c8ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 10 additions & 1 deletion modules/game_data_cleaner/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,21 @@ def _process_file_list(self, file_list_to_process: list) -> dict[list]:

game_entries = game_page.find_all("item")

print(f"Number of game entries in file: {len(game_entries)}")

if len(game_entries) == 0:
print(
f"\n\nNo game entries found in file: {file}. Exiting application."
)
exit()

for game_entry in game_entries:

game_parser = GameEntryParser(game_entry=game_entry)

if not game_parser.check_rating_count_threshold():
continue
print(f"Processing game with ID: {game_entry['id']}")
# print(f"Processing game with ID: {game_entry['id']}")

game_parser.parse_individual_game()
(
Expand Down
3 changes: 1 addition & 2 deletions utils/processing_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ def save_file_local_first(path: str, file_name: str, data: Union[pd.DataFrame, d
def load_file_local_first(path: str = None, file_name: str = ""):

file_path = f"{path}/{file_name}" if path else file_name
print(file_path)

load_path = f"{WORKING_DIR}{file_path}"

print(load_path)
print(f"Loading: {load_path}")

try:
# open from local_pile_path
Expand Down

0 comments on commit f58c8ec

Please sign in to comment.