dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.71k stars 1.48k forks source link

Fix/Support more set operations for the UI asset search bar #18105

Open mkleinbort-ic opened 1 year ago

mkleinbort-ic commented 1 year ago

What's the use case?

We currently have a rich asset selection syntax:

"X_raw"* # Select everything downtream from X_raw
*"X_final" # Select everything upstream from X_final

And this works well with unions

"X_raw"* | *"X_final" # Select everything upstream from X_final or downstream from X_Raw

However, intersections don't work:

"X_raw"* & *"X_final" # Should select Select everything upstream from X_final and downstream from X_raw, but returns the same as "X_raw"* | *"X_final" 

Ideas of implementation

No response

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

mkleinbort-ic commented 12 months ago

Just to highlight the use-case I'd love to support:

Suppose I am trying to do a manual materialization of all assets downstream of X that feed into asset Y

I want to be able to select those assets as "X"* & *"Y" to avoid materializing dozens of irrelevant assets downstream of X and also dozens of assets upstream of Y

In fact, I plan to use these "asset selections" in my documentation/incident resolution.

Eg. when Situation #27 happens kick of this manual materialization as described by url = ...

hellendag commented 11 months ago

Possibly a duplicate request. @bengotow?

bengotow commented 11 months ago

Hey folks! I think this is a great suggestion -- I know we've had requests in the past for AND / OR behavior in the query syntax, and we likely need to add parenthesis support when we do this as well.

I think we're going to wait a bit before we expand this syntax and add more operators because 1) we'd like to extend the syntax through to our python layer (so you could use it when launching materializations from the command-line, etc.) and 2) we've heard from users that we don't do a good job explaining the power of this syntax, and need to surface + teach it better in the UI before we make it even more powerful :-)

In the meantime, the union operator ("|") is actually available in the form of a comma! Because we support asset_a, asset_b, you can also do asset_a*, asset_b* (everything downstream of both those assets).

Related:

15138 ( a -asset_b, "except for" operator request )

14356 (intersection operator)

mkleinbort-ic commented 9 months ago

Yes, I was looking for this today:

https://github.com/dagster-io/dagster/issues/15138 ( a -asset_b, "except for" operator request )

I have a big (500+ asset) DAG that is "beautiful" except for 3 assets that everything depends on. I'd love to see my DAG without those three assets to really see the core logic / show it to stakeholders.