seanpedrickcase
commited on
Commit
•
653bd2d
1
Parent(s):
34bd97b
Added a little more debugging code to lambda_entrypoint
Browse files- lambda_entrypoint.py +5 -0
- tools/cli_redact.py +1 -1
lambda_entrypoint.py
CHANGED
@@ -93,12 +93,17 @@ def lambda_handler(event, context):
|
|
93 |
download_file_from_s3(bucket_name, allow_list, allow_list_path)
|
94 |
command.extend(["--allow_list", allow_list_path])
|
95 |
|
|
|
|
|
96 |
try:
|
97 |
result = subprocess.run(command, capture_output=True, text=True, check=True)
|
98 |
print("Processing succeeded:", result.stdout)
|
99 |
except subprocess.CalledProcessError as e:
|
100 |
print("Error during processing:", e.stderr)
|
101 |
raise e
|
|
|
|
|
|
|
102 |
|
103 |
# Upload output files back to S3
|
104 |
for root, _, files in os.walk(output_dir):
|
|
|
93 |
download_file_from_s3(bucket_name, allow_list, allow_list_path)
|
94 |
command.extend(["--allow_list", allow_list_path])
|
95 |
|
96 |
+
print(f"Running command: {command}")
|
97 |
+
|
98 |
try:
|
99 |
result = subprocess.run(command, capture_output=True, text=True, check=True)
|
100 |
print("Processing succeeded:", result.stdout)
|
101 |
except subprocess.CalledProcessError as e:
|
102 |
print("Error during processing:", e.stderr)
|
103 |
raise e
|
104 |
+
except Exception as e:
|
105 |
+
print(f"Unexpected error: {str(e)}")
|
106 |
+
raise e
|
107 |
|
108 |
# Upload output files back to S3
|
109 |
for root, _, files in os.walk(output_dir):
|
tools/cli_redact.py
CHANGED
@@ -76,7 +76,7 @@ def main(first_loop_state=True, latest_file_completed=0, output_summary="", outp
|
|
76 |
current_loop_page, page_break, args.pii_detector, comprehend_query_num
|
77 |
)
|
78 |
|
79 |
-
print(f"\nRedaction complete. Output
|
80 |
print(f"\nOutput files saved to: {args.output_dir}")
|
81 |
|
82 |
if __name__ == "__main__":
|
|
|
76 |
current_loop_page, page_break, args.pii_detector, comprehend_query_num
|
77 |
)
|
78 |
|
79 |
+
print(f"\nRedaction complete. Output file_list:\n{output_file_list}")
|
80 |
print(f"\nOutput files saved to: {args.output_dir}")
|
81 |
|
82 |
if __name__ == "__main__":
|