Skip to content

Triangle dimension metadata fails to update after TriangleBase.rename #655

@genedan

Description

@genedan

Are you on the latest chainladder version?

  • Yes, this bug occurs on the latest version.

Describe the bug in words

Renaming the columns of the triangle fails to update the attribute Triangle.columns_label. I would suspect the same issue would happen to Triangle.origin_label.

I would also think the reverse issue would happen, where attributes Triangle.columns_label and Triangle.origin_label are re-assigned, but with those changes failing to cascade to the origin and columns indexes.

I think the columns_label case is easier to fix than the origin_label case. We can make Triangle.columns_label a property, which can read the column names from the corresponding index.

origin_label is trickier though, since it seems like that information is lost when creating the origin axis unless stored elsewhere.

How can the bug be reproduced?

import chainladder as cl

genins = cl.load_sample('genins')
genins.rename('columns', 'foo')

print(genins.columns.values)
print(genins.columns_label)

print(genins.columns.values) will output ['bar'] whereas print(genins.columns_label) will output ['values'].

What is the expected behavior?

print(genins.columns_label) should output ['bar'].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort > Brief 🐇Small tasks expected to take a few hours up to a couple of days.Great First Contribution! 🌱Beginner friendly tickets with narrow scope and huge impact. Perfect to join our community!Impact > Minor 🔷Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions