Skip to content

Commit 97d7c52

Browse files
author
Hanson Wei
committed
Added type annotation and docstring for MainCommand data validation
1 parent 9dc034d commit 97d7c52

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gs/backend/data/tables/main_tables.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ class MainCommand(BaseSQLModel, table=True):
4242
__tablename__ = MAIN_COMMAND_TABLE_NAME
4343

4444
@model_validator(mode="after")
45-
def validate_params_format(self):
46-
45+
def validate_params_format(self) -> "MainCommand":
46+
"""
47+
Returns self if params and format are both None or have the same number of comma-separated values.
48+
If one of params or format is missing, or the numbers of comma-separated values do not match, raise DatabaseError.
49+
"""
4750
if self.format is None and self.params is None:
4851
return self
4952

0 commit comments

Comments
 (0)