Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions chainladder/core/tests/test_triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,3 +1061,23 @@ def test_xs(clrd):
assert clrd.xs('comauto',level=1).index.equals(clrd.xs('comauto',level='LOB').index)


def test_to_datetime_uninferrable_format_raises() -> None:
"""
Initialize a triangle with incorrect date format on the origin axis. Should raise a ValueError.

Returns
-------
None

"""
with pytest.raises(ValueError, match="Unable to infer datetime"):
cl.Triangle(
data={
'origin': ['1995/Q1', '1996/Q1'],
'development': ['1995Q1', '1996Q1'],
'value': [1.0, 2.0]},
origin='origin',
development='development',
columns='value',
cumulative=True
)
2 changes: 1 addition & 1 deletion chainladder/core/triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Triangle(TriangleBase):
Parameters
----------
data: DataFrame or DataFrameXchg, or dict
data: DataFrame | DataFrameXchg | dict
A single dataframe that contains columns representing all other
arguments to the Triangle constructor. One may supply a DataFrame-like
object (referred to as DataFrameXchg) supporting the __dataframe__
Expand Down
Loading
Loading