Skip to content

Commit

Permalink
connecting exception stack
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Jan 30, 2024
1 parent c7d92df commit 5cfec11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pescador/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def buffer_stream(stream, buffer_size, partial=False, axis=None):
continue
try:
yield __stack_data(data, axis=axis)
except (TypeError, AttributeError):
raise DataError(f"Malformed data stream: {data}")
except (TypeError, AttributeError) as ex:
raise DataError(f"Malformed data stream: {data}") from ex
finally:
data = []
count = 0
Expand Down Expand Up @@ -169,8 +169,8 @@ def tuples(stream, *keys):
for data in stream:
try:
yield tuple(data[key] for key in keys)
except TypeError:
raise DataError(f"Malformed data stream: {data}")
except TypeError as ex:
raise DataError(f"Malformed data stream: {data}") from ex


def keras_tuples(stream, inputs=None, outputs=None):
Expand Down Expand Up @@ -230,8 +230,8 @@ def keras_tuples(stream, inputs=None, outputs=None):
y = y[0]

yield (x, y)
except TypeError:
raise DataError(f"Malformed data stream: {data}")
except TypeError as ex:
raise DataError(f"Malformed data stream: {data}") from ex


def cache(stream, n_cache, prob=0.5, random_state=None):
Expand Down

0 comments on commit 5cfec11

Please sign in to comment.