Skip to content

[BUG] shift on a pattern stores its display labels as development, and development then raises TypeError #1576

Open

Description

@scks1

Are you on the latest chainladder version?

  • Yes, this bug occurs on the latest version.

Describe the bug in words

Triangle.shift renames the kept columns with self.development. On a pattern, development returns display labels such as "12-24", so after the shift ddims holds strings and reading development raises TypeError when it adds the grain offset to them. The values shift correctly. Seen on main at 8e2e53c.

I ran into it while trying to write the one-year CDR standard error of #1558 with Triangle methods only.

How can the bug be reproduced?

import chainladder as cl

ldf = cl.Development().fit(cl.load_sample("raa")).ldf_
print(ldf.ddims[:2], ldf.shift(1).ddims[:2])
# [12 24] ['12-24' '24-36']
ldf.shift(1).development
# TypeError: unsupported operand type(s) for -: 'str' and 'str'

What is the expected behavior?

import chainladder as cl

ldf = cl.Development().fit(cl.load_sample("raa")).ldf_
assert list(ldf.shift(1).development) == list(ldf.development)

Would you be willing to contribute this ticket?

  • Yes, absolutely!
  • Yes, but I would like some help.
  • No.

(This issue was written with Árbol, an AI assistant, under my direction.)

Activity

  1. henrydingliu commented on Nov 10, 2026

    @henrydingliu
    Member

    this probably have to wait for #1304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Scope

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions