Skip to content

Better error if a Table is passed instead of a TaggedTable #192

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

It is a common error that users pass a Table where a TaggedTable is expected (e.g. to the fit method of models). At the moment this raises an error AttributeError: 'Table' object has no attribute 'features', which neither explains the issue well nor explains how to fix it.

Desired solution

All function that take a TaggedTable as a parameter should raise a custom exception if a Table is passed instead.

  • Validation should happen at the start of the execution of the function
  • Call the exception UntaggedTableError and add it in safeds.data.tabular.exceptions
  • Explain what we mean by "tagging" (marking feature columns and target column of a table)
  • Point to the tag_column method of Table to get a TaggedTable

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Labels

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions