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

depr(snowflake): deprecate from_snowpark method #9680

Merged
Merged
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
6 changes: 3 additions & 3 deletions docs/posts/run-on-snowflake/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ figure out, and these are the questions we will answer throughout the post.

## Getting the Ibis connection

The release of Ibis 9.0 includes the introduction of a new method,
[`from_snowpark`](../../backends/snowflake.qmd#ibis.backends.snowflake.Backend.from_snowpark)
The release of Ibis 9.2 includes the introduction of a new method,
[`from_connection`](../../backends/snowflake.qmd#ibis.backends.snowflake.Backend.from_connection)
to provide users with a convenient mechanism to take an existing Snowpark
session and create an Ibis Snowflake backend instance with it.

Expand All @@ -50,7 +50,7 @@ import ibis
import snowflake.snowpark as sp

session = sp.Session.builder.create()
con = ibis.snowflake.from_snowpark(session)
con = ibis.snowflake.from_connection(session)
```

This connection uses the same session within Snowflake, so temporary objects
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/snowflake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def _setup_session(self, *, session_parameters, create_object_udfs: bool):
f"Unable to create Ibis UDFs, some functionality will not work: {e}"
)

@util.experimental
@util.deprecated(as_of="10.0", instead="use from_connection instead")
Copy link
Member

Choose a reason for hiding this comment

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

experimental, straight to deprecated 😂

@classmethod
def from_snowpark(
cls, session: snowflake.snowpark.Session, *, create_object_udfs: bool = True
Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/snowflake/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def connect(*, tmpdir, worker_id, **kw) -> BaseBackend:
"schema": os.environ["SNOWFLAKE_SCHEMA"],
}
)
return ibis.backends.snowflake.Backend.from_snowpark(builder.create())
return ibis.backends.snowflake.Backend.from_connection(builder.create())
else:
return ibis.connect(_get_url(), **kw)

Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/snowflake/tests/test_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_ibis_inside_snowpark(snowpark_session, execute_as):
def ibis_sproc(session):
import ibis.backends.snowflake

con = ibis.backends.snowflake.Backend.from_snowpark(session)
con = ibis.backends.snowflake.Backend.from_connection(session)

expr = (
con.tables.functional_alltypes.group_by("string_col")
Expand Down
4 changes: 3 additions & 1 deletion ibis/backends/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ def test_create_table_from_schema(con, new_schema, temp_table):
)
def test_create_temporary_table_from_schema(con_no_data, new_schema):
if con_no_data.name == "snowflake" and os.environ.get("SNOWFLAKE_SNOWPARK"):
with pytest.raises(com.IbisError, match="Reconnecting is not supported"):
with pytest.raises(
com.IbisError, match="Cannot reconnect to unconfigured .+ backend"
):
con_no_data.reconnect()
return

Expand Down
Loading