Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-azwiegincew committed Jun 10, 2024
1 parent e508b5d commit 44da249
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/snowflake/snowpark/_internal/server_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def ast_query(self, request_id__ast) -> Any:
f"/queries/v1/query-request?requestId={request_id}", req
)

def phase1_enabled(self) -> bool:
def is_phase1_enabled(self) -> bool:
return os.getenv("SNOWPARK_PHASE_1", False)


Expand Down
4 changes: 2 additions & 2 deletions src/snowflake/snowpark/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3328,12 +3328,12 @@ def _show_string(self, n: int = 10, max_width: int = 50, **kwargs) -> str:
repr.expr.sp_dataframe_show.id.bitfield1 = self._ast_id
self._session._ast_batch.eval(repr)

if self._session._conn.phase1_enabled():
if self._session._conn.is_phase1_enabled():
ast = self._session._ast_batch.flush()
res = self._session._conn.ast_query(ast)
print(f"AST response: {res}")
else:
(_, kwargs["_dataframe_ast"]) = self._session._ast_batch.flush()
_, kwargs["_dataframe_ast"] = self._session._ast_batch.flush()

if is_sql_select_statement(query):
result, meta = self._session._conn.get_result_and_metadata(
Expand Down
3 changes: 2 additions & 1 deletion src/snowflake/snowpark/mock/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,8 @@ def create_coprocessor(self):
# It's not necessary to mock this call.
pass

def phase1_enabled(self):
def is_phase1_enabled(self):
# We don't yet mock Phase 1.
return False


Expand Down
2 changes: 1 addition & 1 deletion src/snowflake/snowpark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def __init__(
self._runtime_version_from_requirement: str = None

# Initialize the server-side session.
if self._conn.phase1_enabled():
if self._conn.is_phase1_enabled():
self._conn.create_coprocessor()

self._ast_batch = AstBatch(self)
Expand Down

0 comments on commit 44da249

Please sign in to comment.