Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AntlrAssetSelectionParser in AssetSelection.from_string #25916

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

briantu
Copy link
Contributor

@briantu briantu commented Nov 14, 2024

Summary & Motivation

We want to use the new AntlrAssetSelectionParser in our backend to parse the new asset selection syntax into an AssetSelection. This should go in a try/catch inside the AssetSelection.from_string method for backwards compatibility.

How I Tested These Changes

Existing tests should pass

@briantu briantu marked this pull request as ready for review November 14, 2024 00:33
@briantu briantu force-pushed the briantu/update-antlr-from-string branch 2 times, most recently from 5dd331f to 49766f5 Compare November 14, 2024 00:34
Copy link

github-actions bot commented Nov 14, 2024

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-3s08hrj05-elementl.vercel.app
https://briantu-update-antlr-from-string.core-storybook.dagster-docs.io

Built with commit 5dd331f.
This pull request is being automatically deployed with vercel-action

@briantu briantu force-pushed the briantu/update-antlr-from-string branch 2 times, most recently from 0615b89 to e857b20 Compare November 14, 2024 03:45
@salazarm
Copy link
Contributor

Can you add more tests to the test file. I did a quick look at them and I only saw 1 test case for the from_string method and it only tested tags which would end up going through antlr.

@briantu briantu force-pushed the briantu/update-antlr-from-string branch from 054f3ad to cd6f320 Compare November 14, 2024 20:22
assert AssetSelection.from_string("+my_asset+") == AssetSelection.assets("my_asset").downstream(
depth=1, include_self=True
) | AssetSelection.assets("my_asset").upstream(depth=1, include_self=True)
assert AssetSelection.from_string("*my_asset*") == AssetSelection.assets("my_asset").downstream(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also test `"my_asset some_other_asset*"

Copy link
Contributor Author

briantu commented Nov 14, 2024

Merge activity

  • Nov 14, 3:50 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Nov 14, 4:08 PM EST: Graphite rebased this pull request as part of a merge.
  • Nov 14, 4:10 PM EST: A user merged this pull request with Graphite.

@briantu briantu changed the base branch from briantu/implement-visitor to graphite-base/25916 November 14, 2024 21:03
@briantu briantu changed the base branch from graphite-base/25916 to master November 14, 2024 21:05
@briantu briantu force-pushed the briantu/update-antlr-from-string branch from 18239ce to 41737dc Compare November 14, 2024 21:07
@briantu briantu merged commit 0530ebe into master Nov 14, 2024
1 check was pending
@briantu briantu deleted the briantu/update-antlr-from-string branch November 14, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants