Page MenuHomePhabricator

Better error message if a chart fails to render if YYYY-MM-DD dates have 00-00 for MM-DD
Closed, ResolvedPublic

Description

While testing a transformation of datetime data, I found that a cell formatted as eg 1850-00-00 results in the chart failing to render with a generic error "There was an error rendering the chart."

Replacing the 00-00 with 01-01 renders successfully.

Screenshot:

image.png (1×2 px, 271 KB)

Expected:

The error should at least specify that the incorrect date format is what's causing the chart to fail to render.

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Fix for isDateSeriesrepos/mediawiki/services/chart-renderer!96bvibberbad-datesmain
Fix for isDateSeriesrepos/mediawiki/services/chart-renderer!95bvibberbad-datesmain
Customize query in GitLab

Event Timeline

Maybe this is not really a bug? Is 00-00 for MM-DD a standard way of identifying a year in YYYY-MM-DD format? My understanding is YYYY-00-00 is not really valid ISO 8601.

It feels like a bug because it just spews a generic error without giving you the slightest idea what you did wrong. If it should cause a failure to render to include a value "1850-00-00" in a data cell then it needs to report that error to the user, with specificity.

CCiufo-WMF renamed this task from Chart fails to render if YYYY-MM-DD dates have 00-00 for MM-DD to Better error message if a chart fails to render if YYYY-MM-DD dates have 00-00 for MM-DD.May 16 2025, 6:24 PM
CCiufo-WMF updated the task description. (Show Details)

It feels like a bug because it just spews a generic error without giving you the slightest idea what you did wrong. If it should cause a failure to render to include a value "1850-00-00" in a data cell then it needs to report that error to the user, with specificity.

Agreed -- I updated the task to reflect this.

CCiufo-WMF triaged this task as Medium priority.May 16 2025, 6:24 PM

Trying to guess data types from strings with no feedback to the user on what the formats are seems very problematic and I would have preferred a more specific system where something like date or year formatting was something you opted into in the chart format JSON.

bvibber edited projects, added Charts (Current Sprint); removed Charts.
bvibber moved this task from Incoming to Code Review on the Charts (Current Sprint) board.