Hi ImkeF,
Please see below response from PG:
We've tracked this issue internally. Note that there's a significant constraint on any change we make which is that the new column type must be inferable from the arguments. That is to say that the following query will currently return "type any" and can be made to return "type text":
let
table = #table(type table [A=text], {{"a"}}),
replaced = Table.ReplaceValue(table, each [A], "ab", Replacer.ReplaceValue, {"A"})
in
Type.TableColumn(Value.Type(replaced), "A")
However, this query will always return "type any", because we can't infer the type of the replaced value:
let
table = #table(type table [A=text], {{"a"}}),
replaced = Table.ReplaceValue(table, each [A], each [A] & "b", Replacer.ReplaceValue, {"A"})
in
Type.TableColumn(Value.Type(replaced), "A")
To make this work as desired, it will be necessary to rewrite that query as
let
table = #table(type table [A=text], {{"a"}}),
replaced = Table.ReplaceValue(table, each [A], (row) as text => row[A] & "b", Replacer.ReplaceValue, {"A"})
in
Type.TableColumn(Value.Type(replaced), "A")
(once the change has been implemented).
Best Regards,
Qiuyun Yu