Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion kagglesdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.15"
__version__ = "0.1.16"

from kagglesdk.kaggle_client import KaggleClient
from kagglesdk.kaggle_creds import KaggleCredentials
Expand Down
26 changes: 26 additions & 0 deletions kagglesdk/competitions/types/competition_api_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,13 +712,19 @@ class ApiCreateSubmissionRequest(KaggleObject):
https://github.com/Kaggle/kaggleazure/blob/9c4bea5548c50844a257f26a10c6c9ae9aaf486b/Kaggle.Services.Competitions/Iam/Competitions/CompetitionsSubmitChecker.cs#L78).
If specified, submit on behalf of this model team instead of
the current user.
sandbox (bool)
Only competition hosts or admins can set true (see checker at
https://github.com/Kaggle/kaggleazure/blob/9c4bea5548c50844a257f26a10c6c9ae9aaf486b/Kaggle.Services.Competitions/Iam/Competitions/CompetitionsSubmitChecker.cs#L69).
If set, this will be a sample submission used for verifying the competition
setup.
"""

def __init__(self):
self._competition_name = ""
self._blob_file_tokens = ""
self._submission_description = None
self._benchmark_model_version_id = None
self._sandbox = None
self._freeze()

@property
Expand Down Expand Up @@ -782,6 +788,25 @@ def benchmark_model_version_id(self, benchmark_model_version_id: Optional[int]):
raise TypeError('benchmark_model_version_id must be of type int')
self._benchmark_model_version_id = benchmark_model_version_id

@property
def sandbox(self) -> bool:
r"""
Only competition hosts or admins can set true (see checker at
https://github.com/Kaggle/kaggleazure/blob/9c4bea5548c50844a257f26a10c6c9ae9aaf486b/Kaggle.Services.Competitions/Iam/Competitions/CompetitionsSubmitChecker.cs#L69).
If set, this will be a sample submission used for verifying the competition
setup.
"""
return self._sandbox or False

@sandbox.setter
def sandbox(self, sandbox: Optional[bool]):
if sandbox is None:
del self.sandbox
return
if not isinstance(sandbox, bool):
raise TypeError('sandbox must be of type bool')
self._sandbox = sandbox

def endpoint(self):
path = '/api/v1/competitions/submissions/submit/{competition_name}'
return path.format_map(self.to_field_map(self))
Expand Down Expand Up @@ -2297,6 +2322,7 @@ def url(self, url: Optional[str]):
FieldMetadata("blobFileTokens", "blob_file_tokens", "_blob_file_tokens", str, "", PredefinedSerializer()),
FieldMetadata("submissionDescription", "submission_description", "_submission_description", str, None, PredefinedSerializer(), optional=True),
FieldMetadata("benchmarkModelVersionId", "benchmark_model_version_id", "_benchmark_model_version_id", int, None, PredefinedSerializer(), optional=True),
FieldMetadata("sandbox", "sandbox", "_sandbox", bool, None, PredefinedSerializer(), optional=True),
]

ApiCreateSubmissionResponse._fields = [
Expand Down
4 changes: 2 additions & 2 deletions kagglesdk/datasets/types/dataset_api_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ class ApiGetDatasetMetadataResponse(KaggleObject):
info (DatasetInfo)
error_message (str)
Required for backwards-compatibility. See
https://github.com/Kaggle/kaggle-api/issues/235
https://github.com/Kaggle/kaggle-cli/issues/235
"""

def __init__(self):
Expand All @@ -1859,7 +1859,7 @@ def info(self, info: Optional['DatasetInfo']):
def error_message(self) -> str:
r"""
Required for backwards-compatibility. See
https://github.com/Kaggle/kaggle-api/issues/235
https://github.com/Kaggle/kaggle-cli/issues/235
"""
return self._error_message or ""

Expand Down