Entitled middle-aged white men sabotaging their own careers is my new favourite sub-genre of news. Well, up until it happens to me, at least.
Only wrote to my MP expressing such concerns… 3 years ago. Better late than never?
Friday 7 July 2023
Dear Andrew Selous,
I’m deeply concerned by the lack of urgency within the current
government (and, frankly, across the country) to legislate regarding
“AI”. I can’t really be more specific than that because the legislative
concerns are enormous: crime, copyright and employment, just for
starters.
I’ve solved the mystery of poltergeists. It’s just #ADHD short-term memory fails and “blindness”…
“I swear, I JUST looked there!”
All the windows are open. Watching horror movies with the subtitles on so the screaming doesn’t bother the neighbours 😂
Turns out my 11-yo daughter has developed a love of disaster movies. Go figure?
Yeah, I agree, what he said.
When you want to make friends but get told off…
Shout out to all the people that complained about Google
Well, that’s interesting!
PowerQuery vs. JSON null or empty list
I had an interesting problem recently when the JSON output from an API started to return a null value instead of empty list. This broke my PowerQuery so I wanted to share a fix.
Originally, I used the built-in “Extract values (from a list)” feature, which concatenated them to make comma separated values:
= Table.TransformColumns(#"Removed Columns", {"List_Field", each Text.Combine(List.Transform(_, Text.From), ","), type text})
And that worked fine. Until the content of that field was not a list. Evidently, this field had previously contained an empty JSON list if it contained no values. I’ve never looked at the JSON itself so I had no idea. So, when the API started returning null for that field instead List.Transform failed:
Expression.Error: We cannot convert the value null to type List.
In some of my other Queries it was also failing “silently” because this step was immediately followed by a RemoveRowsWithErrors step. Whoops. Having no idea that the API output had changed (or what it originally contained) was my big problem here. Took me a while to understand what had gone wrong and how.
The fix itself isn’t complex, simply check if the value is a list before concatenation:
= Table.TransformColumns(#"Removed Columns", {"List_Field", each if Value.Is(_, type list) then Text.Combine(List.Transform(_, Text.From), ",") else null, type text})
However, that DOES make me wonder why the built-in doesn’t automatically add code to check the type. Can’t be that hard…
