Skip to content
Open
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
7 changes: 3 additions & 4 deletions src/regression_model_template/controller/kafka_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,20 @@ def check_input_size(cls, v: Dict[str, Any]) -> Dict[str, Any]:

# Check max rows and consistency
first_len = -1
for key, value in v.items():
for value in v.values():
if not isinstance(value, list):
# If not a list (e.g. single value), pandas might handle it differently,
# but our schema expects Series (lists). Let's assume lists.
continue

current_len = len(value)
if first_len == -1:
if current_len > MAX_INPUT_ROWS:
raise ValueError(f"Input data exceeds maximum limit of {MAX_INPUT_ROWS} rows")
first_len = current_len
elif current_len != first_len:
raise ValueError("All columns must have the same length")

if current_len > MAX_INPUT_ROWS:
raise ValueError(f"Input data exceeds maximum limit of {MAX_INPUT_ROWS} rows")

return v


Expand Down
Loading