Skip to content

Commit ec69608

Browse files
authored
Merge pull request #64 from scaleapi/da/validation_serialization
Minor bugfixes
2 parents 40f9531 + 5834651 commit ec69608

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

nucleus/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ def create_slice(
241241
242242
:return: new Slice object
243243
"""
244-
if dataset_item_ids and reference_ids:
244+
if bool(dataset_item_ids) == bool(reference_ids):
245245
raise Exception(
246-
"You cannot specify both dataset_item_ids and reference_ids"
246+
"You must specify exactly one of dataset_item_ids or reference_ids."
247247
)
248248
payload: Dict[str, Any] = {NAME_KEY: name}
249249
if dataset_item_ids:

nucleus/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def serialize_and_write(
7777
):
7878
for unit in upload_unit:
7979
try:
80-
file_pointer.write(unit.to_json())
80+
file_pointer.write(unit.to_json() + "\n")
8181
except TypeError as e:
8282
type_name = type(unit).__name__
8383
message = (

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = '''
2121

2222
[tool.poetry]
2323
name = "scale-nucleus"
24-
version = "0.1.2"
24+
version = "0.1.3"
2525
description = "The official Python client library for Nucleus, the Data Platform for AI"
2626
license = "MIT"
2727
authors = ["Scale AI Nucleus Team <nucleusapi@scaleapi.com>"]
@@ -32,7 +32,7 @@ documentation = "https://dashboard.scale.com/nucleus/docs/api"
3232
packages = [{include="nucleus"}]
3333

3434
[tool.poetry.dependencies]
35-
python = "^3.6.1"
35+
python = "^3.6.2"
3636
grequests = "^0.6.0"
3737
requests = "^2.25.1"
3838
tqdm = "^4.60.0"

0 commit comments

Comments
 (0)