Skip to content

Commit 3624640

Browse files
authored
Fix merge error from last release (#627)
This fixes a repo problem. It makes the repo consistent with the release.
1 parent 9fd3320 commit 3624640

File tree

6 files changed

+33
-28
lines changed

6 files changed

+33
-28
lines changed

kaggle/api/kaggle_api_extended.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#!/usr/bin/python
2-
#
3-
# Copyright 2024 Kaggle Inc
4-
#
5-
# Licensed under the Apache License, Version 2.0 (the "License");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
1+
#!/usr/bin/python
2+
#
3+
# Copyright 2024 Kaggle Inc
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
1717
#!/usr/bin/python
1818
#
1919
# Copyright 2019 Kaggle Inc
@@ -414,8 +414,8 @@ def authenticate(self):
414414
or self.CONFIG_NAME_KEY not in config_data:
415415
if os.path.exists(self.config):
416416
config_data = self.read_config_file(config_data)
417-
elif self._is_help_or_version_command(api_command) or (
418-
len(sys.argv) > 2 and api_command.startswith(
417+
elif self._is_help_or_version_command(api_command) or (len(
418+
sys.argv) > 2 and api_command.startswith(
419419
self.command_prefixes_allowing_anonymous_access)):
420420
# Some API commands should be allowed without authentication.
421421
return
@@ -1537,15 +1537,18 @@ def dataset_download_files(self,
15371537
except zipfile.BadZipFile as e:
15381538
raise ValueError(
15391539
f"The file {outfile} is corrupted or not a valid zip file. "
1540-
"Please report this issue at https://www.github.com/kaggle/kaggle-api")
1540+
"Please report this issue at https://www.github.com/kaggle/kaggle-api"
1541+
)
15411542
except FileNotFoundError:
15421543
raise FileNotFoundError(
15431544
f"The file {outfile} was not found. "
1544-
"Please report this issue at https://www.github.com/kaggle/kaggle-api")
1545+
"Please report this issue at https://www.github.com/kaggle/kaggle-api"
1546+
)
15451547
except Exception as e:
15461548
raise RuntimeError(
15471549
f"An unexpected error occurred: {e}. "
1548-
"Please report this issue at https://www.github.com/kaggle/kaggle-api")
1550+
"Please report this issue at https://www.github.com/kaggle/kaggle-api"
1551+
)
15491552

15501553
try:
15511554
os.remove(outfile)

kaggle/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,11 +1674,12 @@ class Help(object):
16741674
command_model_instances_new = 'Create a new model instance'
16751675
param_model_instance_downfile = (
16761676
'Folder for downloading the special model-instance-metadata.json file '
1677-
'(https://github.com/Kaggle/kaggle-api/wiki/ModelInstance-Metadata). ')
1677+
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). '
1678+
)
16781679
param_model_instance_upfile = (
16791680
'Folder for upload, containing data files and a '
16801681
'special model-instance-metadata.json file '
1681-
'(https://github.com/Kaggle/kaggle-api/wiki/ModelInstance-Metadata). '
1682+
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). '
16821683
'Defaults to current working directory')
16831684
command_model_instances_delete = 'Delete a model instance'
16841685
command_model_instances_update = 'Update a model instance'

kaggle/models/model_instance_update_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def license_name(self, license_name):
168168
:param license_name: The license_name of this ModelInstanceUpdateRequest. # noqa: E501
169169
:type: str
170170
"""
171-
allowed_values = ["CC BY-NC-SA 4.0", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Attribution 4.0 International (CC BY 4.0)", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "ODC Public Domain Dedication and Licence (PDDL)", "Attribution 3.0 Unported (CC BY 3.0)", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "Community Data License Agreement - Permissive - Version 1.0", "Community Data License Agreement - Sharing - Version 1.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC Attribution License (ODC-By)", "GNU Lesser General Public License 3.0", "GNU Affero General Public License 3.0", "GNU Free Documentation License 1.3", "Apache 2.0", "MIT", "BSD-3-Clause", "GPL 3"] # noqa: E501
171+
allowed_values = ["CC0 1.0", "CC BY-NC-SA 4.0", "Unknown", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Other", "Other (specified in description)", "CC BY 4.0", "Attribution 4.0 International (CC BY 4.0)", "CC BY-NC 4.0", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "PDDL", "ODC Public Domain Dedication and Licence (PDDL)", "CC BY 3.0", "Attribution 3.0 Unported (CC BY 3.0)", "CC BY 3.0 IGO", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "CC BY-NC-SA 3.0 IGO", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "CDLA Permissive 1.0", "Community Data License Agreement - Permissive - Version 1.0", "CDLA Sharing 1.0", "Community Data License Agreement - Sharing - Version 1.0", "CC BY-ND 4.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "CC BY-NC-ND 4.0", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC-BY 1.0", "ODC Attribution License (ODC-By)", "LGPL 3.0", "GNU Lesser General Public License 3.0", "AGPL 3.0", "GNU Affero General Public License 3.0", "FDL 1.3", "GNU Free Documentation License 1.3", "apache-2.0", "Apache 2.0", "mit", "MIT", "bsd-3-clause", "BSD-3-Clause", "Llama 2", "Llama 2 Community License", "Gemma", "gpl-3", "GPL 3", "RAIL-M", "AI Pubs Open RAIL-M License", "AIPubs Research-Use RAIL-M", "AI Pubs Research-Use RAIL-M License", "BigScience OpenRAIL-M", "BigScience Open RAIL-M License", "RAIL", "RAIL (specified in description)", "Llama 3", "Llama 3 Community License"] # noqa: E501
172172
if license_name not in allowed_values:
173173
raise ValueError(
174174
"Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501

kaggle/models/model_new_instance_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def license_name(self, license_name):
236236
"""
237237
if license_name is None:
238238
raise ValueError("Invalid value for `license_name`, must not be `None`") # noqa: E501
239-
allowed_values = ["CC BY-NC-SA 4.0", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Attribution 4.0 International (CC BY 4.0)", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "ODC Public Domain Dedication and Licence (PDDL)", "Attribution 3.0 Unported (CC BY 3.0)", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "Community Data License Agreement - Permissive - Version 1.0", "Community Data License Agreement - Sharing - Version 1.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC Attribution License (ODC-By)", "GNU Lesser General Public License 3.0", "GNU Affero General Public License 3.0", "GNU Free Documentation License 1.3", "Apache 2.0", "MIT", "BSD-3-Clause", "GPL 3"] # noqa: E501
239+
allowed_values = ["CC0 1.0", "CC BY-NC-SA 4.0", "Unknown", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Other", "Other (specified in description)", "CC BY 4.0", "Attribution 4.0 International (CC BY 4.0)", "CC BY-NC 4.0", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "PDDL", "ODC Public Domain Dedication and Licence (PDDL)", "CC BY 3.0", "Attribution 3.0 Unported (CC BY 3.0)", "CC BY 3.0 IGO", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "CC BY-NC-SA 3.0 IGO", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "CDLA Permissive 1.0", "Community Data License Agreement - Permissive - Version 1.0", "CDLA Sharing 1.0", "Community Data License Agreement - Sharing - Version 1.0", "CC BY-ND 4.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "CC BY-NC-ND 4.0", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC-BY 1.0", "ODC Attribution License (ODC-By)", "LGPL 3.0", "GNU Lesser General Public License 3.0", "AGPL 3.0", "GNU Affero General Public License 3.0", "FDL 1.3", "GNU Free Documentation License 1.3", "apache-2.0", "Apache 2.0", "mit", "MIT", "bsd-3-clause", "BSD-3-Clause", "Llama 2", "Llama 2 Community License", "Gemma", "gpl-3", "GPL 3", "RAIL-M", "AI Pubs Open RAIL-M License", "AIPubs Research-Use RAIL-M", "AI Pubs Research-Use RAIL-M License", "BigScience OpenRAIL-M", "BigScience Open RAIL-M License", "RAIL", "RAIL (specified in description)", "Llama 3", "Llama 3 Community License"] # noqa: E501
240240
if license_name not in allowed_values:
241241
raise ValueError(
242242
"Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501

src/kaggle/api/kaggle_api_extended.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ def authenticate(self):
398398
or self.CONFIG_NAME_KEY not in config_data:
399399
if os.path.exists(self.config):
400400
config_data = self.read_config_file(config_data)
401-
elif self._is_help_or_version_command(api_command) or (
402-
len(sys.argv) > 2 and api_command.startswith(
401+
elif self._is_help_or_version_command(api_command) or (len(
402+
sys.argv) > 2 and api_command.startswith(
403403
self.command_prefixes_allowing_anonymous_access)):
404404
# Some API commands should be allowed without authentication.
405405
return

src/kaggle/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,8 @@ class Help(object):
16581658
command_model_instances_new = 'Create a new model instance'
16591659
param_model_instance_downfile = (
16601660
'Folder for downloading the special model-instance-metadata.json file '
1661-
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). ')
1661+
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). '
1662+
)
16621663
param_model_instance_upfile = (
16631664
'Folder for upload, containing data files and a '
16641665
'special model-instance-metadata.json file '

0 commit comments

Comments
 (0)