Skip to content

Commit

Permalink
[#49] code comments cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Sep 18, 2024
1 parent e18ae16 commit bfeadb3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions hsmodels/schemas/rdf/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,15 @@ def sort_columns(table):
# check that column number is in the range of 1 to the length of columns
if any(c < 1 or c > len(table["columns"]) for c in column_numbers):
raise ValueError("column_number values must be between 1 and the number of columns")
# check no duplicate column numbers
if len(column_numbers) != len(set(column_numbers)):
raise ValueError("column_number values must be unique")
table['columns'] = sorted(table['columns'], key=lambda _column: _column['column_number'])
else:
# assign column_order to columns that don't have it
column_numbers = [c.column_number for c in table.columns]
print(column_numbers, flush=True)
# check that column number is in the range of 1 to the length of columns
if any(c < 1 or c > len(table.columns) for c in column_numbers):
raise ValueError("column_number values must be between 1 and the number of columns")
# check no duplicate column numbers
if len(column_numbers) != len(set(column_numbers)):
raise ValueError("column_number values must be unique")
table.columns = sorted(table.columns, key=lambda _column: _column.column_number)
Expand Down

0 comments on commit bfeadb3

Please sign in to comment.