Skip to content

FIX: Make quarterly.csv development dates ISO 8601-compatible.#930

Open
genedan wants to merge 1 commit into
mainfrom
#928-quarterly_warning_attempt_2
Open

FIX: Make quarterly.csv development dates ISO 8601-compatible.#930
genedan wants to merge 1 commit into
mainfrom
#928-quarterly_warning_attempt_2

Conversation

@genedan
Copy link
Copy Markdown
Collaborator

@genedan genedan commented Jun 5, 2026

Summary of Changes

2nd attempt at fixing the warnings for cl.load_sample('quarterly'). Simply changes the development dates to be ISO 8601-compatible, i.e, 1995-04 instead of 1995Q2.

Related GitHub Issue(s)

#840
#928

Additional Context for Reviewers

I decided to keep the test introduced in #929 because that ValueError block was uncovered and needed a test anyway:

if datetime_mapping is None:
raise ValueError(
"Unable to infer datetime for field(s): " + str(fields) +
". Please check the underlying data or any supplied format arguments."
)

Also made a change to the triangle docstring data argument which was causing typing warnings.

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Low Risk
Scope is sample CSV formatting, a docstring type hint, and a new regression test; no changes to core Triangle parsing logic beyond what existing _to_datetime already does.

Overview
Updates the quarterly sample dataset so development dates use ISO-friendly strings (1995-01, 1995-04, …) instead of 1995Q1-style labels, eliminating pandas datetime-inference warnings when calling cl.load_sample('quarterly'). Numeric cells in the CSV are unchanged aside from dropping trailing .0 on integers.

Also documents the Triangle constructor data parameter with a modern union type (DataFrame | DataFrameXchg | dict), and adds test_to_datetime_uninferrable_format_raises to assert a ValueError with message "Unable to infer datetime" when origin/development strings cannot be parsed.

Reviewed by Cursor Bugbot for commit a708691. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.30%. Comparing base (31b3432) to head (a708691).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #930      +/-   ##
==========================================
+ Coverage   88.28%   88.30%   +0.01%     
==========================================
  Files          88       88              
  Lines        5029     5029              
  Branches      642      642              
==========================================
+ Hits         4440     4441       +1     
+ Misses        444      443       -1     
  Partials      145      145              
Flag Coverage Δ
unittests 88.30% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants