SNOW-2912540: remap write_pandas missing-table errors via ProgrammingError.raw_msg - #4328
Open
sfc-gh-fpawlowski wants to merge 1 commit into
Open
Conversation
…Error.raw_msg Co-authored-by: Cursor <cursoragent@cursor.com>
Author
3 tasks
sfc-gh-fpawlowski
force-pushed
the
SNOW-2912540-write-pandas-raw-msg
branch
from
August 23, 2026 22:52
1fddef5 to
0c1595c
Compare
sfc-gh-fpawlowski
marked this pull request as ready for review
August 24, 2026 12:19
sfc-gh-fpawlowski
requested review from
sfc-gh-aling,
sfc-gh-bkogan and
sfc-gh-yixie
and removed request for
a team
August 24, 2026 12:19
Comment on lines
+3631
to
+3632
| msg = getattr(pe, "raw_msg", pe.msg) | ||
| if msg.endswith("does not exist"): |
Contributor
There was a problem hiding this comment.
Potential AttributeError if raw_msg attribute exists but is None. The getattr function only returns the default value when the attribute doesn't exist, not when it exists with a None value. If pe.raw_msg is None, line 3632 will call None.endswith() and crash.
Fix:
msg = getattr(pe, "raw_msg", None) or pe.msg
if msg.endswith("does not exist"):Or add a null check:
msg = getattr(pe, "raw_msg", pe.msg)
if msg and msg.endswith("does not exist"):
Suggested change
| msg = getattr(pe, "raw_msg", pe.msg) | |
| if msg.endswith("does not exist"): | |
| msg = getattr(pe, "raw_msg", None) or pe.msg | |
| if msg.endswith("does not exist"): | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Session.write_pandasremapped a missing table only whenProgrammingError.msgended with"does not exist"..msgwith(request_id=..., sfqid=...), so the remap never fired and raw001757leaked.getattr(pe, "raw_msg", pe.msg)instead — both v4 and v5 store the unformatted body there.Context
Stacked on #4326. Recovers
test_write_pandas/test_write_pandas_with_overwriteon UD (CI run 32475873257, 9 unique tests / 18 grouped failures).Test plan
tests/integ/test_pandas_to_df.py::test_write_pandastests/integ/test_pandas_to_df.py::test_write_pandas_with_overwrite.raw_msg/.msgboth end with"does not exist").Made with Cursor