Skip to content

Surpress Invalid ifmt #431

@johalnes

Description

@johalnes

Hi,

This might be an user error and not "issue", but still would love some feedback. I got a column that is completely blank. To handle this, but also keep it within the data in case it get value some time in the future I tried to force it to string:

def read_fact_sheet(excel_file: Path):
    specific_dtype = {"Notes": "string"}
    workbook = read_excel(excel_file)
    df_sheet = workbook.load_sheet("Sheet1", header_row=1, dtypes=specific_dtype)
    return df_sheet.to_polars() 

But I still get the "count" below. Is it any way to make it force string before checking for type inference? Other alternatives then suppress warning?

>> uv run python excel_load.py
Invalid ifmt value: '0'
Invalid ifmt value: '1'
Invalid ifmt value: '2'
Invalid ifmt value: '3'
Invalid ifmt value: '4'
Invalid ifmt value: '9'
Invalid ifmt value: '11'
Invalid ifmt value: '12'
Invalid ifmt value: '13'
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions