SNOW-2912540: translate create_temp_table=True to table_type in AST encoding - #4296
Closed
sfc-gh-fpawlowski wants to merge 2 commits into
Closed
SNOW-2912540: translate create_temp_table=True to table_type in AST encoding#4296sfc-gh-fpawlowski wants to merge 2 commits into
sfc-gh-fpawlowski wants to merge 2 commits into
Conversation
…ncoding The deprecated `create_temp_table` parameter was being emitted to the proto AST as a separate boolean field even though the runtime already translates it to `table_type="temporary"`. This meant the AST decoder had to handle two representations for the same thing. Fix: move the deprecation coercion before the AST block in save_as_table so `table_type` is already resolved when emitted; remove the deprecated field from both AST emission sites (WriteTable and WritePandas); update the internal cache_result mock path to pass table_type="temp" directly; mark the proto fields as deprecated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_table removal Remove create_temp_table from the expected encoded AST and unparser output in the write_pandas golden test — the field is no longer emitted to the proto since the deprecation coercion now happens before the AST block, making table_type the sole carrier of this information. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ud-local-test-scripts #4296 +/- ##
==========================================================
- Coverage 95.20% 54.25% -40.96%
==========================================================
Files 171 170 -1
Lines 44463 44061 -402
Branches 7606 7534 -72
==========================================================
- Hits 42331 23904 -18427
- Misses 1320 19069 +17749
- Partials 812 1088 +276 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sfc-gh-fpawlowski
marked this pull request as ready for review
July 28, 2026 16:36
sfc-gh-fpawlowski
requested review from
sfc-gh-mayliu,
sfc-gh-yixie and
sfc-gh-yuwang
and removed request for
a team
July 28, 2026 16:36
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends #4282 by fixing an AST encoding inconsistency: when a caller passes the deprecated
create_temp_table=Trueparameter, the Python runtime correctly translates it totable_type="temporary", but the AST proto was still recordingcreate_temp_table=Trueas a separate boolean field — forcing the server-side AST decoder to handle two representations for the same thing.Changes:
dataframe_writer.py: Movecreate_temp_tabledeprecation coercion to before the AST emission block insave_as_table, sotable_typeis already resolved whenWriteTableis encoded. Removeexpr.create_temp_tableemission.session.py: Removeast.create_temp_table = create_temp_tablefrom thewrite_pandasAST block — the coercion already fires before AST emission there, soast.table_typecarries the correct value.dataframe.py: Replacecreate_temp_table=Truewithtable_type="temp"in the internalcache_resultmock path, matching the real code path and avoiding a spurious deprecation warning from internal code.ast.proto: Mark bothcreate_temp_tablefields as// Deprecated: use table_type instead.(fields retained for wire compatibility).tests/ast/data/session_write_pandas.test: Removecreate_temp_table: truefrom expected encoded AST andcreate_temp_table=Truefrom expected unparser output.Test plan
tests/integ/test_dataframe.pydeprecation-warning test (~line 5371) — warning still fires,table_typestill resolves correctlytests/integ/test_pandas_to_df.pydeprecation-warning test (~line 385) — sametests/ast/golden file tests pass with updatedsession_write_pandas.testcache_resultmock path no longer emits a deprecation warning🤖 Generated with Claude Code