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

Upgrade a couple deprecation warnings to errors #2887

Merged
merged 1 commit into from
Feb 21, 2025
Merged
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
26 changes: 8 additions & 18 deletions modal/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
synchronizer,
warn_if_generator_is_not_consumed,
)
from ._utils.deprecation import deprecation_warning, renamed_parameter
from ._utils.deprecation import deprecation_error, deprecation_warning, renamed_parameter
from ._utils.function_utils import (
ATTEMPT_TIMEOUT_GRACE_PERIOD,
OUTPUTS_TIMEOUT,
Expand Down Expand Up @@ -309,13 +309,8 @@ class FunctionStats:

def __getattr__(self, name):
if name == "num_active_runners":
msg = (
"'FunctionStats.num_active_runners' is deprecated."
" It currently always has a value of 0,"
" but it will be removed in a future release."
)
deprecation_warning((2024, 6, 14), msg)
return 0
msg = "'FunctionStats.num_active_runners' is no longer available."
deprecation_error((2024, 6, 14), msg)
raise AttributeError(f"'FunctionStats' object has no attribute '{name}'")


Expand Down Expand Up @@ -513,16 +508,11 @@ def from_local(
retries, f"Function '{info.get_tag()}'" if info.raw_f else f"Class '{info.get_tag()}'"
)

if webhook_config is not None and retry_policy is not None:
raise InvalidError(
"Web endpoints do not support retries.",
)

if is_generator and retry_policy is not None:
deprecation_warning(
(2024, 6, 25),
"Retries for generator functions are deprecated and will soon be removed.",
)
if retry_policy is not None:
if webhook_config is not None:
raise InvalidError("Web endpoints do not support retries.")
if is_generator:
raise InvalidError("Generator functions do not support retries.")

if proxy:
# HACK: remove this once we stop using ssh tunnels for this.
Expand Down
Loading