Skip to content

Commit

Permalink
Merge branch 'main' into revert-2496-lmukhopadhyay-SNOW-1760125-disab…
Browse files Browse the repository at this point in the history
…le-precommit-test
  • Loading branch information
sfc-gh-lmukhopadhyay authored Oct 24, 2024
2 parents 61a6b74 + a3cbf9b commit 84aeba5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
- Fixed a bug where the automatic cleanup of temporary tables could interfere with the results of async query execution.
- Fixed a bug in `DataFrame.analytics.time_series_agg` function to handle multiple data points in same sliding interval.

#### Deprecations:

- Deprecated warnings will be triggered when using snowpark-python with Python 3.8. For more details, please refer to https://docs.snowflake.com/en/developer-guide/python-runtime-support-policy.

### Snowpark pandas API Updates

#### New Features
Expand Down
24 changes: 24 additions & 0 deletions src/snowflake/snowpark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
]


import sys
import warnings

from snowflake.snowpark.version import VERSION

__version__ = ".".join(str(x) for x in VERSION if x is not None)
Expand Down Expand Up @@ -69,3 +72,24 @@
WhenNotMatchedClause,
)
from snowflake.snowpark.window import Window, WindowSpec

_deprecation_warning_msg = (
"Python Runtime 3.8 reached its End-Of-Life (EOL) on October 14, 2024, there will be no further bug fixes "
"or security updates for this runtime. We recommend that you upgrade your existing Python 3.8 objects to "
"Python 3.9, 3.10 or 3.11 before March 31, 2025. Please note that end of support does not impact execution, "
"and you will still be able to update and invoke existing objects. "
"However, they will be running on an unsupported runtime which will no longer be maintained or patched by "
"the Snowflake team. For more details, please refer "
"to https://docs.snowflake.com/en/developer-guide/python-runtime-support-policy."
)
warnings.filterwarnings(
"once", # ensure the warning is only shown once to avoid warning explosion
message=_deprecation_warning_msg,
)

if sys.version_info.major == 3 and sys.version_info.minor == 8:
warnings.warn(
_deprecation_warning_msg,
category=DeprecationWarning,
stacklevel=2,
)
27 changes: 27 additions & 0 deletions tests/unit/test_deprecation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#

import importlib
import sys

import pytest

import snowflake.snowpark


def test_py38_deprecation():
if not (sys.version_info.major == 3 and sys.version_info.minor == 8):
pytest.skip("This test is for Python 3.8 only")

with pytest.warns(
DeprecationWarning, match="Python Runtime 3.8 reached its End-Of-Life"
) as record:
importlib.reload(snowflake.snowpark)

assert len(record) == 1

# import again won't trigger the warning
with pytest.warns(None) as record:
importlib.import_module("snowflake.snowpark")
assert len(record) == 0

0 comments on commit 84aeba5

Please sign in to comment.