Skip to content

Commit 8e2dce2

Browse files
committed
Update API to 1.5.2
1 parent 80c3ddf commit 8e2dce2

22 files changed

+39
-24
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
====
33

4+
#### 1.5.2
5+
Release date: 1/28/19
6+
* Don't error on encoding errors when printing tables
7+
* Exit with error code when an exception is caught
8+
49
#### 1.5.1.1
510
Release date: 12/5/18
611
* Add missing cli option for dataset subfolders

KaggleSwagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ security:
3131
- basicAuth: []
3232
externalDocs:
3333
description: Further Kaggle documentation
34-
url: https://www.kaggle.com
34+
url: www.kaggle.com
3535
tags:
3636
- name: kaggle
3737
parameters:

kaggle/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

kaggle/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

kaggle/api/kaggle_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

kaggle/api/kaggle_api_extended.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@
6262

6363

6464
class KaggleApi(KaggleApi):
65-
__version__ = '1.5.1.1'
65+
__version__ = '1.5.2'
6666

6767
CONFIG_NAME_PROXY = 'proxy'
6868
CONFIG_NAME_COMPETITION = 'competition'
@@ -2132,7 +2132,10 @@ def print_table(self, items, fields):
21322132
print(row_format.format(*borders))
21332133
for i in items:
21342134
i_fields = [self.string(getattr(i, f)) + ' ' for f in fields]
2135-
print(row_format.format(*i_fields))
2135+
try:
2136+
print(row_format.format(*i_fields))
2137+
except UnicodeEncodeError:
2138+
print(row_format.format(*i_fields).encode('utf-8'))
21362139

21372140
def print_csv(self, items, fields):
21382141
""" print a set of fields in a set of items using a csv.writer

kaggle/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

kaggle/cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -46,20 +46,27 @@ def main():
4646
command_args.update(vars(args))
4747
del command_args['func']
4848
del command_args['command']
49+
error = False
4950
try:
5051
out = args.func(**command_args)
5152
except ApiException as e:
5253
print(str(e.status) + ' - ' + e.reason)
5354
out = None
55+
error = True
5456
except ValueError as e:
5557
print(e)
5658
out = None
59+
error = True
5760
except KeyboardInterrupt:
5861
print('User cancelled operation')
5962
out = None
6063
if out is not None:
6164
print(out, end='')
6265

66+
# This is so that scripts that pick up on error codes can tell when there was a failure
67+
if error:
68+
exit(1)
69+
6370

6471
def parse_competitions(subparsers):
6572
if six.PY2:

kaggle/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

kaggle/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
#
3-
# Copyright 2018 Kaggle Inc
3+
# Copyright 2019 Kaggle Inc
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)