Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conf-Import fails without error if single cell contains string #163

Open
philippkraft opened this issue Nov 8, 2024 · 3 comments
Open

Comments

@philippkraft
Copy link
Member

We need a clear warning if a column that is defined for import is of dtype 'object'. If that is the case, the none float values in the column should be found and listed, with the suggestion to move them to the No-Data list.

@philippkraft
Copy link
Member Author

In pandas_import.load_dataframe we need a check of each Value-Column like:

for col in df.columns:
    try:
        df[col] = df[col].astype('float')
    except (ValueError, TypeError) as e:
        warnings.append(f'Column {col} cannot be imported: {e}')

@philippkraft
Copy link
Member Author

Return value of load_dataframe should be changed to df, warnings and return the dataframe together with a list of warnings. Need to check all places where load_dataframe is referenced.

`load_dataframe' is called from

  • webpage.filemanager.dbimport
  • submit(...)
  • test_di_pandas_import
  • interactive_import

@philippkraft
Copy link
Member Author

Check if really all columns in load_dataframe must be float

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant