When automagic guessing fails and type/Text is treated as a date

I’ve got a perfectly reproducible case where the line/bar chart visualizations are breaking, and I’d love some pointers about how to unbreak things – it’s kind of a show-stopper for adoption in my case. (it’s a fairly simple setup, writing questions on MariaDB views)

A few GitHub references:

For reference, here’s what Metabase knows about the view I’m using (Parts To Start):

Part Num is a simple type/Text field, and I’d really expect it to not make any guesses about how to interpret this field – it’s simply text, treat it as such.

Here’s what it looks like in table view – just some part numbers and sums:

The bar chart visualization is trying a little too hard to be smart – if I wanted it to be a date, I should be able to say it’s a date value (of some format), encoded in a text field. Alas, I don’t seem to have that option, so I’m left with an entirely useless visualization that failed at doing something clever:

And here’s the result to drilling into whatever that mangled part number is (no way to tell it that I’m not actually talking about April 03, 1003):

Why is Metabase trying, in such an obviously broken way, to be clever about what’s in a text field? Is there an option where I can tell it to stop trying to guess? If we care about interpreted text as a date, why isn’t that an option in Field type?

This is quite frustrating… in other questions, when I’m lucky, the first part number is something like “075030”, which doesn’t parse as a date, so the visualization works:

Can anyone shed some light on this? Is it a back-end problem? Front-end? Where can I look in the code to see what it’s trying to do? Is there any current work that is addressing this?

I’ve only dug far enough to wonder if
/frontend/src/metabase/lib/schema_metadata.js or /frontend/src/metabase/visualizations/components/LineAreaBarChart.jsx are to blame, but I’ve kind of hit a dead-end.

(edit: more forum permissions, I can include more links and images now)

I found an easier way to trigger this bug –

First, a filter on some data that doesn’t get treated as a date:

Then, a filter that makes the data get reinterpreted: