Skip to content

Commit

Permalink
Fix typechecked not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
aversey committed Jul 11, 2024
1 parent 2ff44ac commit 6203644
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/hopsworks/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#

import functools
import os


def not_connected(fn):
Expand Down Expand Up @@ -53,3 +54,15 @@ def __init__(self):
super().__init__(
"Connection is not active. Needs to be connected for hopsworks operations."
)

if os.environ.get("HOPSWORKS_RUN_WITH_TYPECHECK", False):
from typeguard import typechecked
else:
from typing import TypeVar

_T = TypeVar("_T")

def typechecked(
target: _T,
) -> _T:
return target if target else typechecked

0 comments on commit 6203644

Please sign in to comment.