blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.85k stars 405 forks source link

Stackoverflow on group by file #858

Open NomarCub opened 2 years ago

NomarCub commented 2 years ago

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

blacksmithgu commented 2 years ago

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 commented 2 years ago

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.

NomarCub commented 2 years ago

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

blacksmithgu commented 2 years ago

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

NomarCub commented 2 years ago

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.

AB1908 commented 2 years ago

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

NomarCub commented 2 years ago

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

s-blu commented 1 year ago

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

NomarCub commented 5 months ago

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