Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdk-test-utils: Measure payload size with len, not getsizeof #3157

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def get_shared_result_data():
bool_key=str(True),
float_key=str(1.23),
nested=str(dict(key="value")),
payload_size=163,
payload_size=114,
)
expected_rows_object = {"first": "two", "payload_size": 80, "second": "2"}
expected_rows_object = {"first": "two", "payload_size": 31, "second": "2"}

return expected_object, expected_rows_object

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
import datetime
import logging
import sys
from dataclasses import dataclass
from typing import Dict
from typing import List
Expand Down Expand Up @@ -63,7 +62,7 @@ def pre_ingest_process(
start_time = datetime.datetime(year=2022, month=1, day=27, hour=16)
metadata = IngestionMetadata({"ingestion_submission_start_time": start_time})
for i in payload:
payload_size = sys.getsizeof(str(i))
payload_size = len(str(i))
i["payload_size"] = payload_size
processed_payloads.append(i)

Expand Down
Loading