sfguide-data-engineering-with-snowpark-python icon indicating copy to clipboard operation
sfguide-data-engineering-with-snowpark-python copied to clipboard

Use session as context manager in examples

Open sfc-gh-turbaszek opened this issue 1 year ago • 0 comments

To align with best practices and to assure that session are really closed in case of errors examples should use snowpakr sesson in the following way:

    with Session.builder.getOrCreate() as session:
        print(main(session, *sys.argv[1:]))  # type: ignore

sfc-gh-turbaszek avatar Feb 19 '24 08:02 sfc-gh-turbaszek