Skip to content
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
2 changes: 2 additions & 0 deletions mabel/adapters/google/google_cloud_storage_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def commit(self, byte_data, override_blob_name=None):
# name from the path builder
if override_blob_name:
blob_name = override_blob_name
if blob_name.startswith(self.bucket + "/"):
blob_name = blob_name[len(self.bucket) + 1 :]
else:
blob_name = self._build_path()

Expand Down
3 changes: 1 addition & 2 deletions mabel/data/internals/group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def _map(self, collect_columns):
for record in self._dictset:
try:
group_key: int = xxh3_64_intdigest(
"".join([str(record[column]) for column in self._columns]),
HASH_SEED
"".join([str(record[column]) for column in self._columns]), HASH_SEED
)
except KeyError:
group_key: int = xxh3_64_intdigest(
Expand Down
7 changes: 0 additions & 7 deletions mabel/data/writers/internals/blob_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class BlobWriter(object):
# this variable outside the __init__.
buffer = bytearray()
byte_count = 0
manifest = {}

def __init__(
self,
Expand Down Expand Up @@ -141,7 +140,6 @@ def commit(self):
if self.records_in_buffer > 0:
lock = threading.Lock()

summary = None
try:
lock.acquire(blocking=True, timeout=10)

Expand All @@ -155,10 +153,6 @@ def commit(self):
)

pytable = self.wal.arrow()
try:
summary = self.wal.profile.to_dicts()
except Exception as e:
print(f"[MABEL] Unable to profile morsel - {type(e).__name__} - {e}")

# if we have a schema, make effort to align the parquet file to it
if self.schema:
Expand All @@ -179,7 +173,6 @@ def commit(self):
committed_blob_name = self.inner_writer.commit(
byte_data=write_buffer, override_blob_name=None
)
self.manifest[committed_blob_name] = summary

if "BACKOUT" in committed_blob_name:
get_logger().warning(
Expand Down
4 changes: 3 additions & 1 deletion tests/test_data_group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def test_gappy_set():
{"AVG(key)": 1.0, "value": "one"},
]

assert set(tuple(sorted(d.items())) for d in gs) == set(tuple(sorted(d.items())) for d in expected)
assert set(tuple(sorted(d.items())) for d in gs) == set(
tuple(sorted(d.items())) for d in expected
)


if __name__ == "__main__": # pragma: no cover
Expand Down
3 changes: 2 additions & 1 deletion tests/test_writer_batch_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest

sys.path.insert(1, os.path.join(sys.path[0], ".."))

from mabel.adapters.disk import DiskReader, DiskWriter
from mabel.data import BatchWriter
from mabel.data import Reader
Expand Down Expand Up @@ -215,7 +216,7 @@ def get_data():


if __name__ == "__main__": # pragma: no cover
from tests.helpers.runner import run_tests
from helpers.runner import run_tests

test_writer_without_schema_parquet()
run_tests()
Loading