Перейти к содержанию

excel

get_column_index

get_column_index(
    field_name: str, field_names: list[str]
) -> int

We put absent element allways in the tail of result and in the end truncate this cell

Source code in api/utils/excel.py
162
163
164
165
166
167
168
169
def get_column_index(
    field_name: str,
    field_names: list[str],
) -> int:
    """We put absent element allways in the tail of result and in the end truncate this cell"""
    with suppress(ValueError):
        return field_names.index(field_name)
    return -1