Skip to content

Commit

Permalink
Add warning when running UDFs that Python 3.7 is going away. (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetorpedodog authored Jan 22, 2024
1 parent 4635a0f commit cdaa3e4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tiledb/cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This file imports specifically to re-export.

import sys
import warnings

from . import compute
from . import dag
from . import groups
Expand Down Expand Up @@ -38,6 +41,15 @@
from .tasks import task
from .tiledb_cloud_error import TileDBCloudError

if sys.version_info < (3, 8):
warnings.warn(
DeprecationWarning(
"Python 3.7 has been deprecated and support will soon be fully"
" discontinued. Upgrade to Python 3.9 as soon as possible."
)
)


_pickle_compat.patch_cloudpickle()
_pickle_compat.patch_pandas()

Expand Down
9 changes: 9 additions & 0 deletions src/tiledb/cloud/dag/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import itertools
import json
import numbers
import sys
import threading
import time
import uuid
Expand Down Expand Up @@ -608,6 +609,14 @@ def __init__(
:param deadline: Duration in seconds relative to the workflow start time
which the workflow is allowed to run before it gets terminated.
"""
if sys.version_info < (3, 8):
warnings.warn(
DeprecationWarning(
"Python 3.7 has been deprecated and support will soon be fully"
" discontinued. Upgrade to Python 3.9 as soon as possible."
)
)

self.id = uuid.uuid4()
self.nodes: Dict[uuid.UUID, Node] = {}
self.nodes_by_name: Dict[str, Node] = {}
Expand Down
9 changes: 9 additions & 0 deletions src/tiledb/cloud/udf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import base64
import sys
import uuid
import warnings
from typing import Any, Callable, Iterable, Optional, Union
Expand Down Expand Up @@ -81,6 +82,14 @@ def exec_base(
:param kwargs: named arguments to pass to function
"""

if sys.version_info < (3, 8):
warnings.warn(
DeprecationWarning(
"Python 3.7 has been deprecated and support will soon be fully"
" discontinued. Upgrade to Python 3.9 as soon as possible."
)
)

if result_format_version:
warnings.warn(DeprecationWarning("result_format_version is unused."))

Expand Down

0 comments on commit cdaa3e4

Please sign in to comment.