Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemessick committed Feb 14, 2025
1 parent 3b56732 commit a35bf37
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions kagglesdk/kernels/types/kernels_api_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,9 +1216,9 @@ class ApiSaveKernelRequest(KaggleObject):
`{username}/{model-slug}/{framework}/{variation-slug}`
Or versioned:
`{username}/{model-slug}/{framework}/{variation-slug}/{version-number}`
max_session_execution_time (int)
session_timeout_seconds (int)
If specified, terminate the kernel session after this many seconds of
runtime.
runtime, which must be lower than the global maximum.
"""

def __init__(self):
Expand All @@ -1238,7 +1238,7 @@ def __init__(self):
self._enable_internet = None
self._docker_image_pinning_type = None
self._model_data_sources = []
self._max_session_execution_time = None
self._session_timeout_seconds = None
self._freeze()

@property
Expand Down Expand Up @@ -1501,21 +1501,21 @@ def model_data_sources(self, model_data_sources: Optional[List[str]]):
self._model_data_sources = model_data_sources

@property
def max_session_execution_time(self) -> int:
def session_timeout_seconds(self) -> int:
r"""
If specified, terminate the kernel session after this many seconds of
runtime.
runtime, which must be lower than the global maximum.
"""
return self._max_session_execution_time or 0
return self._session_timeout_seconds or 0

@max_session_execution_time.setter
def max_session_execution_time(self, max_session_execution_time: int):
if max_session_execution_time is None:
del self.max_session_execution_time
@session_timeout_seconds.setter
def session_timeout_seconds(self, session_timeout_seconds: int):
if session_timeout_seconds is None:
del self.session_timeout_seconds
return
if not isinstance(max_session_execution_time, int):
raise TypeError('max_session_execution_time must be of type int')
self._max_session_execution_time = max_session_execution_time
if not isinstance(session_timeout_seconds, int):
raise TypeError('session_timeout_seconds must be of type int')
self._session_timeout_seconds = session_timeout_seconds

def endpoint(self):
path = '/api/v1/kernels/push'
Expand Down Expand Up @@ -1923,7 +1923,7 @@ def creation_date(self, creation_date: str):
FieldMetadata("enableInternet", "enable_internet", "_enable_internet", bool, None, PredefinedSerializer(), optional=True),
FieldMetadata("dockerImagePinningType", "docker_image_pinning_type", "_docker_image_pinning_type", str, None, PredefinedSerializer(), optional=True),
FieldMetadata("modelDataSources", "model_data_sources", "_model_data_sources", str, [], ListSerializer(PredefinedSerializer())),
FieldMetadata("maxSessionExecutionTime", "max_session_execution_time", "_max_session_execution_time", int, None, PredefinedSerializer(), optional=True),
FieldMetadata("sessionTimeoutSeconds", "session_timeout_seconds", "_session_timeout_seconds", int, None, PredefinedSerializer(), optional=True),
]

ApiSaveKernelResponse._fields = [
Expand Down

0 comments on commit a35bf37

Please sign in to comment.