Skip to content

SNOW-2984982 add support for drop object --if-exists#2729

Merged
sfc-gh-jwilkowski merged 3 commits intomainfrom
wkot/SNOW-2984982-add-support-for-drop-if-exists
Jan 14, 2026
Merged

SNOW-2984982 add support for drop object --if-exists#2729
sfc-gh-jwilkowski merged 3 commits intomainfrom
wkot/SNOW-2984982-add-support-for-drop-if-exists

Conversation

@sfc-gh-jwilkowski
Copy link
Contributor

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.
  • I've described my changes in the documentation.

Changes description

fixes #1994

sfc-gh-wkot and others added 3 commits January 9, 2026 13:31
Closes #1994

This change adds support for the --if-exists flag to the snow object drop
command, allowing users to drop objects only if they exist. This mirrors
the SQL syntax DROP ... IF EXISTS ..., preventing errors when attempting
to drop non-existent objects.

Changes:
- Added if_exists parameter to ObjectManager.drop() method
- Added --if-exists option to the drop command in commands.py
- Added unit tests for the new functionality
@sfc-gh-jwilkowski sfc-gh-jwilkowski marked this pull request as ready for review January 9, 2026 14:07
@sfc-gh-jwilkowski sfc-gh-jwilkowski requested a review from a team as a code owner January 9, 2026 14:07
@sfc-gh-jwilkowski
Copy link
Contributor Author

@sfc-gh-wkot thanks for your contribution in #2726! I had to create a new PR and fixed some tests, so please give it a look :)

Copy link

@sfc-gh-asawicki sfc-gh-asawicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sfc-gh-jwilkowski sfc-gh-jwilkowski merged commit 4514e23 into main Jan 14, 2026
24 checks passed
@sfc-gh-jwilkowski sfc-gh-jwilkowski deleted the wkot/SNOW-2984982-add-support-for-drop-if-exists branch January 14, 2026 10:59
@waldekkot
Copy link

Super ! Thanks ! I was not aware that the snowpark command behaves a bit differently from the other ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support --if-exists flag for snow object drop command

4 participants