snowflakedb/snowflake-cli

SNOW-1269784: Snow Snowpark Build/Deploy Issues (can't manually zip folder)

Closed this issue · 3 comments

SnowCLI version

2.1.1

Python version

3.11.7

Platform

macOS-10.16-x86_64-i386-64bit

What happened

This is a bit weird, but I have a need to build my snowpark project, unzip the package, and make a modification to a sub-module. I found a bug in the process, which I have isolated the issue down to simply unzipping and zipping the package, no changes necessary.

  1. if you build the package with snow build, and deploy it with snow deploy, it works fine.
  2. if you build the package with snow build, open the zipped package, re-zip the folder, and then deploy it with snow deploy, it ends up not being able to find modules that are clearly in the package. The deploy does not fail, the procedure being called just fails at runtime.

The screen recording walks through these two paths above, illustrating the breaking point is simply opening and re-zipping the folder generated by snow build.

Screen.Recording.2024-03-25.at.14.39.58.mov

Console output

Python Interpreter Error:
ModuleNotFoundError: No module named 'procedures' in function HELLO_PROCEDURE with handler procedures.hello_procedure

How to reproduce

  1. Init a snowpark project
  2. run snow build to build the project zip
  3. open/extract the project zip, delete existing zip file
  4. compress the expanded project folder to create a new zip
  5. run snow deploy for the new zip
  6. call procedure

I did go back and test v2.0.0 and v2.1.0 as well, and they have the same issue.

Hi,

It looks like your manually created zip contains extra app 2/ due to compressing folder and not only its content.
Can you compare content and paths of both archives using unzip -l <name_of_archive>.zip ?

Oh! you're right, compressing the folder does nest everything in the parent folder. Consider this a non-issue, thanks!