Skip to content

Commit

Permalink
add received to test event
Browse files Browse the repository at this point in the history
  • Loading branch information
ayirr7 committed Jul 3, 2023
1 parent d07d4f0 commit e542463
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions snuba/datasets/processors/transactions_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,11 @@ def process_message(
# the following operation modifies the event_dict and is therefore *not* order-independent
self._process_contexts_and_user(processed, event_dict)

raw_received = _collapse_uint32(int(event_dict["data"]["received"]))
received = (
datetime.utcfromtimestamp(raw_received)
if raw_received is not None
else None
)
if event_dict["data"]["received"] is not None:
raw_received = _collapse_uint32(int(event_dict["data"]["received"]))
assert raw_received is not None
received = datetime.utcfromtimestamp(raw_received)
else:
received = None

return InsertBatch([processed], received)
3 changes: 3 additions & 0 deletions tests/datasets/test_transaction_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ def __get_transaction_event(self) -> TransactionEvent:
op="navigation",
timestamp=finish,
start_timestamp=start,
received=(
datetime.now(tz=timezone.utc) - timedelta(seconds=15)
).timestamp(),
platform="python",
dist="",
user_name="me",
Expand Down

0 comments on commit e542463

Please sign in to comment.