Skip to content

Commit 9c2ae57

Browse files
authored
FIx for GetAllVintageSeriesResult.to_pd_data_frame (#67)
1 parent bde34f6 commit 9c2ae57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

macrobond_data_api/common/types/get_all_vintage_series_result.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from dataclasses import dataclass
2+
from itertools import chain
23

34
from typing import TYPE_CHECKING, Any, Dict, Sequence, overload, List
45

@@ -36,9 +37,12 @@ def to_pd_data_frame(self) -> "DataFrame":
3637
"""
3738
import pandas # pylint: disable=import-outside-toplevel
3839

40+
dates = list(set(chain.from_iterable((x.dates for x in self.series))))
41+
dates.sort()
42+
3943
df = pandas.DataFrame(
4044
{
41-
**{"date": self.series[len(self.series) - 1].dates},
45+
**{"date": dates},
4246
}
4347
)
4448

0 commit comments

Comments
 (0)