-
Notifications
You must be signed in to change notification settings - Fork 111
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
[feature branch] AST test infra #1701
[feature branch] AST test infra #1701
Conversation
Can we maybe avoid checking in the .jar file? It's 22MB which will make any changesets large... |
@@ -1133,7 +1133,8 @@ def select( | |||
|
|||
stmt = self._session._ast_batch.assign() | |||
ast = stmt.expr | |||
ast.sp_dataframe_select__columns.df.sp_dataframe_ref.id.bitfield1 = self._ast_id | |||
# TODO: remove the None guard below once we generate the correct AST. |
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 is 666 about? I assume just some random id for now?
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.
Yeah. Once we get full coverage of the API, this won't be necessary to make the mock setup pass.
@@ -795,6 +795,9 @@ def get_result_query_id(self, plan: SnowflakePlan, **kwargs) -> str: | |||
# get the iterator such that the data is not fetched | |||
result_set, _ = self.get_result_set(plan, to_iter=True, **kwargs) | |||
return result_set["sfqid"] | |||
|
|||
def create_coprocessor(self): |
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.
would we add in the future any functionality to this? Or is this a simple stub? In any case maybe a short comment to address either 1.) what needs to get added here or 2.) that this should not be removed, but left because of ... would help :)
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.
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.
lgtm, only concern is the 22MB file. Can we avoid checking that in?
037fc60
into
server-side-snowpark
AST Tests
This driver enables testing of the AST generation that will be used in the server-side Snowpark implementation, starting with Phase 0.
All generated AST should be tested using this mechanism. To add a test, create a new file under
tests/ast/data
. Files look like the following example. The test driver sets up the session and looks at the accumulated lazy values in the resulting environment.N.B. No eager evaluation is permitted, as any intermediate batches will not be observed. This can easily be changed if necessary, however.
To generate the expected output the first time the test is run, or when the AST generation changes, run: