generated from rochacbruno/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Problem
Several methods don't validate required parameters before making API calls, which can lead to unclear error messages or unexpected behavior.
Affected code:
add_data_batch()doesn't validatetable_idis providedget_all_rows()doesn't check iftable_idis validcreate_field()doesn't validatefield_typeagainst allowed types- Constructor doesn't validate
tokenformat
Solution
Add input validation at the start of each public method:
def add_data_batch(self, table_id: int, data: List[Dict]) -> None:
if not table_id or not isinstance(table_id, int):
raise ValueError("table_id must be a positive integer")
if not data or not isinstance(data, list):
raise ValueError("data must be a non-empty list")
# ... rest of methodBenefits
- Fail fast with clear error messages
- Better developer experience
- Easier debugging
Ich sehe alles. Oliver.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels