Skip to content

Commit 818d36a

Browse files
author
Ubuntu
committed
Review feedback
1 parent 10a30ea commit 818d36a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

nucleus/dataset_item.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,13 @@ class DatasetItem: # pylint: disable=R0902
122122
123123
124124
Attributes:
125-
image_location: (required if pointcloud_location not present) The location
125+
image_location: Required if pointcloud_location not present: The location
126126
containing the image for the given row of data. This can be a local path, or a remote URL.
127127
Remote formats supported include any URL (http:// or https://) or URIs for AWS S3, Azure, or GCS,
128128
(i.e. s3://, gcs://)
129-
reference_id: (required) A user-specified identifier to reference the item.
129+
reference_id: (required) A user-specified identifier to reference the item. The
130+
default value is present in order to not have to change argument order, but
131+
must be replaced.
130132
metadata: Extra information about the particular dataset item. ints, floats,
131133
string values will be made searchable in the query bar by the key in this dict
132134
For example, {"animal": "dog"} will become searchable via
@@ -156,24 +158,24 @@ class DatasetItem: # pylint: disable=R0902
156158
so your second ingestion will be faster than your first.
157159
TODOC(Shorten this once we have a guide migrated for metadata, or maybe link
158160
from other places to here.)
159-
pointcloud_location: (required if image_location not passed) The remote URL
161+
pointcloud_location: Required if image_location not present: The remote URL
160162
containing the pointcloud JSON. Remote formats supported include any URL
161163
(http:// or https://) or URIs for AWS S3, Azure, or GCS, (i.e. s3://, gcs://)
162-
upload_to_scale: Set this to false in order to use `privacy mode<https://dashboard.scale.com/nucleus/docs/api#privacy-mode>`_. TODOC (update this once guide is migrated).
163-
Briefly speaking, setting this to flase means the actual data within the item
164+
upload_to_scale: Set this to false in order to use `privacy mode <https://dashboard.scale.com/nucleus/docs/api#privacy-mode>`_. TODOC (update this once guide is migrated).
165+
Setting this to false means the actual data within the item
164166
(i.e. the image or pointcloud) will not be uploaded to scale meaning that
165167
you can send in links that are only accessible to certain users, and not to
166168
Scale.
167169
"""
168170

169171
image_location: Optional[str] = None
170-
reference_id: Optional[str] = None
172+
reference_id: str = "DUMMY_VALUE" # Done in order to preserve argument ordering and not break old clients.
171173
metadata: Optional[dict] = None
172174
pointcloud_location: Optional[str] = None
173175
upload_to_scale: Optional[bool] = True
174176

175177
def __post_init__(self):
176-
assert self.reference_id is not None, "reference_id is required."
178+
assert self.reference_id != "DUMMY_VALUE", "reference_id is required."
177179
assert bool(self.image_location) != bool(
178180
self.pointcloud_location
179181
), "Must specify exactly one of the image_location, pointcloud_location parameters"

0 commit comments

Comments
 (0)