Handle None values in added and removed #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tested the script in 6.0.2 and ran in to the following errors.
Obtaining new batch of events (Offset: 0 | Limit 1000) {'entityType': 'project', 'name': 'app-sec', 'fieldName': 'downloadedFiles', 'fieldType': 'sequence', 'before': None, 'after': None, 'unit': None, 'added': 'auditevents_20250312_170711.csv', 'removed': ''} {'entityType': 'project', 'name': 'app-sec'} {'entityType': 'run', 'name': 'LauncherRunCommand'} {'entityType': 'run', 'name': 'LauncherRunCommand'} Traceback (most recent call last): File "/mnt/export_audit_trail.py", line 313, in <module> main() File "/mnt/export_audit_trail.py", line 119, in main export_audit_trail(args.hostname, request_headers, request_params) File "/mnt/export_audit_trail.py", line 172, in export_audit_trail parsed_events = parse_events(raw_events) File "/mnt/export_audit_trail.py", line 207, in parse_events parsed_events.append(parse_event(raw_event)) File "/mnt/export_audit_trail.py", line 244, in parse_event target_data = flatten_target(targets_raw[0]) File "/mnt/export_audit_trail.py", line 300, in flatten_target target_data["added"] = ','.join([obj.get("name") for obj in target.get("added", [])]) TypeError: sequence item 0: expected str instance, NoneType found