Skip to content

Safe fallback from ElementType to Type in update_or_create_hierarchy_from_dataframe #1418

Description

@MariusWirtz

There is a usability mismatch between:

  • elements.get_elements_dataframe() defaulting element_type_column="Type"
  • hierarchies.update_or_create_hierarchy_from_dataframe() defaulting element_type_column="ElementType"

Changing defaults now would break backward compatibility.
Could we add a safe fallback in update_or_create_hierarchy_from_dataframe:

  1. Use ElementType if present.
  2. If missing, use Type only when all non-null values match valid element type values.
  3. If validation fails, treat Type as a regular attribute and raise a clear error that ElementType is required.

This avoids breaking existing scripts while preventing conflicts where Type is a genuine dimension attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions