Skip to content

Commit fde777c

Browse files
author
Diego Ardila
committed
Nudge more for upgrades
1 parent 1a2eaa8 commit fde777c

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ Nucleus is a new way—the right way—to develop ML models, helping us move awa
1717

1818
`$ pip install scale-nucleus`
1919

20+
## Common issues/FAQ
21+
22+
### Outdated Client
23+
24+
Nucleus is iterating rapidly and at the moment and as a result we do not perfectly preserve backwards compatibility with older versions of the client. If you run into any error, please make sure you first
25+
upgrade your version of the client by running
26+
27+
```
28+
pip install --upgrade scale-nucleus
29+
```
30+
2031
## Usage
2132

2233
The first step to using the Nucleus library is instantiating a client object.

nucleus/errors.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import pkg_resources
2+
3+
nucleus_client_version = pkg_resources.get_distribution(
4+
"scale-nucleus"
5+
).version
6+
7+
18
class ModelCreationError(Exception):
29
def __init__(self, message="Could not create the model"):
310
self.message = message
@@ -28,9 +35,9 @@ class NucleusAPIError(Exception):
2835
def __init__(
2936
self, endpoint, command, requests_response=None, aiohttp_response=None
3037
):
31-
38+
message = f"Your client is on version {nucleus_client_version}. Before reporting this error, please make sure you update to the latest version of the client by running pip install --upgrade scale-nucleus"
3239
if requests_response is not None:
33-
message = f"Tried to {command.__name__} {endpoint}, but received {requests_response.status_code}: {requests_response.reason}."
40+
message += f"Tried to {command.__name__} {endpoint}, but received {requests_response.status_code}: {requests_response.reason}."
3441
if hasattr(requests_response, "text"):
3542
if requests_response.text:
3643
message += (
@@ -39,7 +46,7 @@ def __init__(
3946

4047
if aiohttp_response is not None:
4148
status, reason, data = aiohttp_response
42-
message = f"Tried to {command.__name__} {endpoint}, but received {status}: {reason}."
49+
message += f"Tried to {command.__name__} {endpoint}, but received {status}: {reason}."
4350
if data:
4451
message += f"\nThe detailed error is:\n{data}"
4552

0 commit comments

Comments
 (0)