-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fix for glob patterns in artifacts #1567
Conversation
if "*" in str(artefact): | ||
raise ValueError("Glob patterns not supported for Snowpark artifacts.") | ||
return artifacts | ||
def get_artifacts(self) -> List[PathMapping]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NADE's path globbing logic is centralized in BundleMap. Any particular reason we can't reuse it here instead of doing a one-off implementation? I'm worried that different glob expansion implementations will end up making things confusing for customers since the specific globbing semantics can diverge over time (and reading what's below, might have diverged already TBH).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call BundleMap
from Streamlit and Snowpark plugins, or extract this code to any common module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If BundleMap
is generic and easy to use we can use this implementation. If it's too tightly coupled with NA implementation I'm in favor of solving this in separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intended to be generic, but feel free to take a look and tell me what you think.
main_file: streamlit_app.py | ||
artifacts: | ||
- streamlit_app.py | ||
- pages/*.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, and particular reason to use *.*
, instead of just *
? I've never seen that pattern used before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular reason. In this context they should have the same result.
_artifacts = [] | ||
for artifact in self.artifacts: | ||
if "*" in str(artifact): | ||
root = artifact.parent.absolute() if "**" not in str(artifact) else Path(".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, is this also supposed to support **/*
-style paths? That would be excellent!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should
d13c5f6
to
01f7b02
Compare
Co-authored-by: Zachary Blackwood <zachary.blackwood@snowflake.com>
547af2a
to
5f5aef2
Compare
Pull request was closed
Pre-review checklist
Changes description
Fix for #1529 - allows using glob patterns in artifact fields.
Adds getters, to ensure that the Snowpark artefacts are returned as a list of PathMappings