obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

Stackoverflow on group by file

Open NomarCub opened this issue 3 years ago • 9 comments

What happened?

image

The example is from the untouched Obsidian Help vault.

DQL

TASK
GROUP BY file

JS

No response

Dataview Version

0.4.23d

Obsidian Version

0.13.23

OS

Windows

NomarCub avatar Feb 15 '22 19:02 NomarCub

file is an object which contains a bunch of file metadata (it's copied from the file the task is in for task queries); the correct query is

TASK GROUP BY file.link

or alternatively,

TASK GROUP BY link(path)

Task queries now automatically group by file by default again in 0.4.23e as well.

It seems this issue is caused by the file property on task referencing file.tasks which references the original task again, causing a self-referential object. Unfortunate side effect of adding file metadata in the (unwise) way that I did, instead of putting it behind a link (which would then unfortunately mean file metadata would be accessible via file.file.link and similar).

blacksmithgu avatar Feb 16 '22 00:02 blacksmithgu

For now, I'll simply break the cyclical reference which will prevent the error. The output of TASK GROUP BY file will still not look very good though; I'll have to make a breaking change at some point in the future to change mechanically how task queries get data from their parent file.

blacksmithgu avatar Feb 16 '22 00:02 blacksmithgu

With the new release (0.5.22) this completely freezes Obsidian. Please reopen this issue.

NomarCub avatar Jun 03 '22 22:06 NomarCub

Are you still grouping by file? Have you tried grouping by file.link?

blacksmithgu avatar Jun 03 '22 22:06 blacksmithgu

I know I can use file.link. But I'd still like to get this fixed. Especially now that typing this makes the whole app freeze completely, only because I didn't get dataview code right.

NomarCub avatar Jun 04 '22 09:06 NomarCub

I've had Obs freeze up completely at times as well.

AB1908 avatar Jul 01 '22 13:07 AB1908

GROUP BY file.tasks is also very compute heavy and yields incomprehensible output, don't know if it's related.

NomarCub avatar Jul 19 '22 17:07 NomarCub

Probably related to #991. Might be the same issue.

s-blu avatar Dec 23 '22 19:12 s-blu

The only thing this query lets me do is scroll it, it freezes every other view and spins up my computer a lot. The sandbox vault seems to be small enough for it to not freeze. Here's what it looks like:

image

NomarCub avatar Mar 20 '24 21:03 NomarCub