Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1798928:[API Coverage] SessionBuilder app_name #2664

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- To `MapType`:
- `keyType`: keys of the map
- `valueType`: values of the map
- Added support for method `appName` in `SessionBuilder`.
- Added support for `include_nulls` argument in `DataFrame.unpivot`.

#### Improvements
Expand Down
2 changes: 2 additions & 0 deletions src/snowflake/snowpark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ def _create_internal(
_add_session(new_session)
return new_session

appName = app_name

def __get__(self, obj, objtype=None):
return Session.SessionBuilder()

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ def test_session_builder_app_name_no_existing_query_tag(
builder, "_create_internal", return_value=mocked_session
) as m:
assert builder.app_name(app_name, format_json=format_json) is builder
# test alias
assert builder.appName(app_name, format_json=format_json) is builder
created_session = builder.getOrCreate()
m.assert_called_once()
assert created_session.query_tag == expected_query_tag
Expand Down
Loading