Huh, just occurred to me to try it in the script console, and it works there.
query = "with linedates as (select generate_series('2021-04-05'::date, '2021-04-09'::date, '1 day'::interval) as linedate) select linedates.linedate, count(evl.id) FROM linedates left join employee_vacation_log evl on vacationdate = linedates.linedate group by 1 order by linedates.linedate"
args = []
db = "postgres"
system.db.runPrepQuery(query, args, db)
Result:
Jython 2.5.3 (v2.5.3:3d2dbae23c52+, Nov 17 2012, 11:51:23)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_201
>>>
<PyDataset rows:5 cols:2>
>>>