Skip to content

Commit b56747a

Browse files
committed
Removed error_count property in abstract_producer
1 parent ac6dbf2 commit b56747a

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

sdk/python/feast/loaders/abstract_producer.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ class AbstractProducer:
2525
def __init__(self, brokers: str, row_count: int, disable_progress_bar: bool):
2626
self.brokers = brokers
2727
self.row_count = row_count
28-
self.error_count = 0
29-
self.last_exception = ""
3028

3129
# Progress bar will always display average rate
3230
self.pbar = tqdm(
@@ -45,8 +43,6 @@ def _inc_pbar(self, meta):
4543
self.pbar.update(1)
4644

4745
def _set_error(self, exception: str):
48-
self.error_count += 1
49-
self.last_exception = exception
5046
raise Exception(exception)
5147

5248
def print_results(self) -> None:
@@ -63,24 +59,7 @@ def print_results(self) -> None:
6359

6460
print("Ingestion complete!")
6561

66-
failed_message = (
67-
""
68-
if self.error_count == 0
69-
else f"\nFail: {self.error_count / self.row_count}"
70-
)
71-
72-
last_exception_message = (
73-
""
74-
if self.last_exception == ""
75-
else f"\nLast exception:\n{self.last_exception}"
76-
)
77-
78-
print(
79-
f"\nIngestion statistics:"
80-
f"\nSuccess: {self.pbar.n}/{self.row_count}"
81-
f"{failed_message}"
82-
f"{last_exception_message}"
83-
)
62+
print(f"\nIngestion statistics:" f"\nSuccess: {self.pbar.n}/{self.row_count}")
8463
return None
8564

8665

@@ -205,8 +184,6 @@ def flush(self, timeout: Optional[int]):
205184
provided timeout
206185
"""
207186
messages = self.producer.flush(timeout=timeout)
208-
if self.error_count:
209-
raise Exception(self.last_exception)
210187
if messages:
211188
raise Exception("Not all Kafka messages are successfully delivered.")
212189
return messages

0 commit comments

Comments
 (0)