Skip to content

Commit 860b328

Browse files
authored
Bugfix/send to checkpoint v2 events (#402)
* fix `send-to` w/ checkpoint and v2 json events * bump version for release
1 parent 21d5585 commit 860b328

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The intended audience of this file is for py42 consumers -- as such, changes tha
99
how a consumer would use the library (e.g. adding unit tests, updating documentation, etc) are not captured here.
1010

1111

12-
## 1.16.3 - 2023-02-01
12+
## 1.16.5 - 2023-02-01
1313

1414
### Fixed
1515

src/code42cli/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.16.4"
1+
__version__ = "1.16.5"

src/code42cli/cmds/securitydata.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,17 @@ def send_to(
513513
if state.profile.use_v2_file_events != "True":
514514
deprecation_warning(DEPRECATION_TEXT)
515515

516+
flatten = format in (OutputFormat.TABLE, OutputFormat.CSV)
517+
516518
if use_checkpoint:
517519
cursor = _get_file_event_cursor_store(state.profile.name)
518520
checkpoint = _handle_timestamp_checkpoint(cursor.get(use_checkpoint), state)
519521

520522
if state.profile.use_v2_file_events == "True":
521523

522524
def checkpoint_func(event):
523-
cursor.replace(use_checkpoint, event["event.id"])
525+
event_id = event["event.id"] if flatten else event["event"]["id"]
526+
cursor.replace(use_checkpoint, event_id)
524527

525528
else:
526529

0 commit comments

Comments
 (0)