Snowflake-Labs / sfguide-data-engineering-with-snowpark-python

Apache License 2.0
111 stars 3.32k forks source link

Incorrect logic to map snowcli to snowpark connection params #25

Open Peeyush-Now opened 1 year ago

Peeyush-Now commented 1 year ago

Inside utils/snowpark_utils.py

THIS WILL NOT WORK AS THE KEYS BETWEEN SNOWCLI AND SNOWPARK ARE DIFFERENT!!

    # Convert snowsql connection variable names to snowcli ones
    # session_config_dict = {
    #     snowsql_to_snowpark_config_mapping[k]: v.strip('"')
    #     for k, v in session_config.items()
    # }

WE NEED TO IETRATE OVER BOTH DICTIONARIES AT THE SAME TIME

    session_config_dict = {}
    for (k1,v1), (k2,v2) in zip(snowsql_to_snowpark_config_mapping.items(), session_config.items()):
        session_config_dict[k1] = v2.strip('"')

Also, inside steps/02_load_raw.py

perhaps make this more foolproof

  # current_dir = os.getcwd()
  current_dir = os.path.dirname(os.path.abspath(__file__))
Peeyush-Now commented 1 year ago

Sorry about the CAPS!!

impawan commented 11 months ago

I was facing issue related to path, thanks @Peeyush-Now this worked for me