Page MenuHomePhabricator

Add lexer/parser for subselection language

Authored by schrockn on Sep 5 2019, 2:46 AM.


Group Reviewers
Restricted Project
R1:c7eefa21a1aa: Add lexer/parser for subselection language

I had a bit of time and am holding off on pressing forward on the runs db pending the dagster instance refactor.

So I made a first stab at a lexer/parser for the selection syntax to select many solids. This is largely based on
the dbt syntax. This is a bit overkill given the current language, but I strongly suspect we will make this
more complicated as time goes on, so I set it up properly.

Tracking progress in

What this will enable (eventually) is typing at the command line or in
dagit UI. "+some_solid" which would select all solids necessary to
execute up to some_solid.

Test Plan


Diff Detail

R1 dagster
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

schrockn created this revision.Sep 5 2019, 2:46 AM
schrockn updated this revision to Diff 4252.Sep 5 2019, 3:30 AM
schrockn edited the summary of this revision. (Show Details)


nate added a subscriber: nate.Sep 5 2019, 5:27 PM

looks reasonable to me. Main question on my end is that as this gets more sophisticated, will we want to just use an off the shelf parsing/lexing library vs building our own? I can see the logic here getting pretty complicated. Thoughts?


this is probably premature optimization, but this is going to do a regex compare character by character - maybe there's a cheaper way to evaluate?

nate accepted this revision.Sep 5 2019, 5:28 PM
This revision is now accepted and ready to land.Sep 5 2019, 5:28 PM

I actually think a parsing/lexing libraries are generally overrated, but then again I've never really used them that much. We've never had to use them for GraphQL and that works fine and this is way simpler, as a reference point.


definitely premature optimization. these are never going to be very long

This revision was automatically updated to reflect the committed changes.