harbor run -t openthoughts/tasktrove-exp-rpt-curriculum-medium-curriculum-medium-0310harbor download openthoughts/tasktrove-exp-rpt-curriculum-medium-curriculum-medium-0310Goal
What to implement
def get_time_series(series_name: str = None, symbol: str = None, last: int = None, output_format: str = None): """ Retrieve time-series data (stubbed for testing).
- series_name: name of the time-series to fetch (e.g., "REPORTED_FINANCIALS").
- symbol: ticker symbol (e.g., "AAPL").
- last: number of most recent periods to include (positive int). If None, use a sensible default (e.g., 3).
- output_format: if exactly "pandas", return a pandas.DataFrame; otherwise return a Python list.
"""
...
When output_format == "pandas":
When output_format is None or any value other than "pandas":
test_params calls: data = get_time_series("REPORTED_FINANCIALS", "AAPL", last=1)
So your DataFrame must have its columns attribute as a pandas DatetimeIndex. For last=1, this means exactly 1 column.
Edge cases to consider (moderate, to test robustness)
Implementation hints (do not reveal the full solution)
Deliverable
Notes