Skip to content

Commit

Permalink
Remove deprecated items (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineechen committed Mar 19, 2024
1 parent 1907551 commit 7de880a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 87 deletions.
3 changes: 0 additions & 3 deletions runhouse/resources/functions/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,6 @@ def to(
self,
env: Optional[List[str]] = [],
cloud: str = "aws_lambda",
# Variables below are deprecated
reqs: Optional[List[str]] = None,
setup_cmds: Optional[List[str]] = [],
force_install: Optional[bool] = False,
):
"""
Expand Down
17 changes: 1 addition & 16 deletions runhouse/resources/functions/function_factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import re
import warnings
from pathlib import Path
from typing import Callable, List, Optional, Union

Expand All @@ -20,8 +19,6 @@ def function(
dryrun: bool = False,
load_secrets: bool = False,
serialize_notebook_fn: bool = False,
reqs: Optional[List[str]] = None, # deprecated
setup_cmds: Optional[List[str]] = None, # deprecated
):
"""runhouse.function(fn: str | Callable | None = None, name: str | None = None, system: str | Cluster | None = None, env: str | List[str] | Env | None = None, dryrun: bool = False, load_secrets: bool = False, serialize_notebook_fn: bool = False)
Expand Down Expand Up @@ -64,19 +61,7 @@ def function(
# Try reloading existing function
return Function.from_name(name, dryrun)

if setup_cmds:
warnings.warn(
"``setup_cmds`` argument has been deprecated. "
"Please pass in setup commands to rh.Env corresponding to the function instead."
)
if reqs is not None:
warnings.warn(
"``reqs`` argument has been deprecated. Please use ``env`` instead."
)
env = Env(
reqs=reqs, setup_cmds=setup_cmds, working_dir="./", name=Env.DEFAULT_NAME
)
elif not isinstance(env, Env):
if not isinstance(env, Env):
env = _get_env_from(env) or Env(working_dir="./", name=Env.DEFAULT_NAME)

fn_pointers = None
Expand Down
4 changes: 0 additions & 4 deletions runhouse/resources/hardware/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,8 +1435,6 @@ def share(
visibility: Optional[Union[ResourceVisibility, str]] = None,
notify_users: bool = True,
headers: Optional[Dict] = None,
# Deprecated
access_type: Union[ResourceAccess, str] = None,
) -> Tuple[Dict[str, ResourceAccess], Dict[str, ResourceAccess]]:

# save cluster and creds if not saved
Expand All @@ -1452,7 +1450,6 @@ def share(
visibility=visibility,
notify_users=notify_users,
headers=headers,
access_type=access_type,
)

# share cluster
Expand All @@ -1462,7 +1459,6 @@ def share(
visibility=visibility,
notify_users=notify_users,
headers=headers,
access_type=access_type,
)

@classmethod
Expand Down
7 changes: 0 additions & 7 deletions runhouse/resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pprint
import sys
import warnings
from enum import Enum
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
Expand Down Expand Up @@ -366,8 +365,6 @@ def share(
visibility: Optional[Union[ResourceVisibility, str]] = None,
notify_users: bool = True,
headers: Optional[Dict] = None,
# Deprecated
access_type: Union[ResourceAccess, str] = None,
) -> Tuple[Dict[str, ResourceAccess], Dict[str, ResourceAccess]]:
"""Grant access to the resource for a list of users (or a single user). If a user has a Runhouse account they
will receive an email notifying them of their new access. If the user does not have a Runhouse account they will
Expand Down Expand Up @@ -438,10 +435,6 @@ def share(
f"For example: `{self.name}.to(system='s3')`"
)

if access_type is not None:
warnings.warn("`access_type` is deprecated, please use `access_level`")
access_level = access_type

if isinstance(access_level, str):
access_level = ResourceAccess(access_level)

Expand Down
57 changes: 0 additions & 57 deletions runhouse/rns/top_level_rns_fns.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,60 +160,3 @@ def ipython():
def delete(resource_or_name: str):
"""Delete the resource from the RNS or local config store."""
rns_client.delete_configs(resource=resource_or_name)


# ----------------- Pinning objects to cluster memory -----------------
from runhouse import globals


def pin_to_memory(key: str, value):
# Deprecate after 0.0.12
import warnings

warnings.warn(
"pin_to_memory is deprecated, use `rh.here.put` instead", DeprecationWarning
)
rh_config.obj_store.put(key, value)


def get_pinned_object(key: str, default=None):
# Deprecate after 0.0.12
import warnings

warnings.warn(
"get_pinned_object is deprecated, use `rh.here.get` instead", DeprecationWarning
)
return rh_config.obj_store.get(key, default=default)


def remove_pinned_object(key: str):
# Deprecate after 0.0.12
import warnings

warnings.warn(
"remove_pinned_object is deprecated, use `rh.here.delete` instead",
DeprecationWarning,
)
globals.obj_store.delete(key)


def pinned_keys():
# Deprecate after 0.0.12
import warnings

warnings.warn(
"pinned_keys is deprecated, use `rh.here.keys` instead",
DeprecationWarning,
)
return globals.obj_store.keys()


def clear_pinned_memory():
# Deprecate after 0.0.12
import warnings

warnings.warn(
"clear_pinned_memory is deprecated, use `rh.here.clear` instead",
DeprecationWarning,
)
globals.obj_store.clear()

0 comments on commit 7de880a

Please sign in to comment.