-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add snowpark entities #1959
base: main
Are you sure you want to change the base?
Add snowpark entities #1959
Conversation
…ntities # Conflicts: # tests/streamlit/__snapshots__/test_commands.ambr # tests/test_data/projects/example_streamlit_v2/snowflake.yml
…tities_basic # Conflicts: # src/snowflake/cli/_plugins/streamlit/streamlit_entity.py
if not FeatureFlag.ENABLE_NATIVE_APP_CHILDREN.is_enabled(): | ||
raise NotImplementedError("Snowpark entity is not implemented yet") |
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.
What's the reasoning behind this flag?
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 was introduced in #1856
As we are not introducing entities in commands just yet, it seems reasonable to turn them off by default.
allow_shared_libraries: bool = False, | ||
*args, | ||
**kwargs, | ||
): |
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.
Please add type hint
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.
Done
def get_execute_sql(self, execution_arguments: List[str] | None = None): | ||
raise NotImplementedError | ||
|
||
def get_usage_grant_sql(self, app_role: str): |
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.
def get_usage_grant_sql(self, app_role: str): | |
def get_usage_grant_sql(self, role: str): |
There's nothing app specific in this query as far as I can tell
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.
Done
def get_describe_sql(self): | ||
return f"DESCRIBE {self.model.type.upper()} {self.identifier}" | ||
|
||
def get_drop_sql(self): | ||
return f"DROP {self.model.type.upper()} {self.identifier}" | ||
|
||
def get_execute_sql(self, execution_arguments: List[str] | None = None): | ||
raise NotImplementedError | ||
|
||
def get_usage_grant_sql(self, app_role: str): | ||
return f"GRANT USAGE ON {self.model.type.upper()} {self.identifier} TO ROLE {app_role}" |
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.
Good candidates to extract to parent, generic class.
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.
Done
762aa80
to
801b67d
Compare
""" | ||
# 0 Create a directory for the entity | ||
if not output_dir: | ||
output_dir = self.root / "output" / self.model.stage |
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.
Output dir should be "output/bundle/snowpark"
return "\n".join(query) | ||
|
||
def get_execute_sql(self, execution_arguments: List[str] | None = None): | ||
raise NotImplementedError |
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 this be not implemented?
e1deb64
to
9a34c4b
Compare
Pre-review checklist
Changes description
Basic implementation of snowpark entities - to be updated after introducing bundle map for all entities.