File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/labelbox/schema/internal Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 55from labelbox .pydantic_compat import BaseModel
66from labelbox .schema .identifiable import UniqueId , GlobalKey
77from labelbox import pydantic_compat
8+ from labelbox .schema .data_row import DataRow
89
910
1011class DataRowItemBase (ABC , pydantic_compat .BaseModel ):
@@ -78,7 +79,8 @@ def is_empty(self) -> bool:
7879 or the only key is `dataset_id`.
7980 :return: bool
8081 """
81- row_data = self .payload .get ("row_data" , None )
82+ row_data = self .payload .get ("row_data" , None ) or self .payload .get (
83+ DataRow .row_data , None )
8284 return (not self .payload or len (self .payload .keys ()) == 1 and
8385 "dataset_id" in self .payload or row_data is None or
8486 len (row_data ) == 0 )
Original file line number Diff line number Diff line change 77from labelbox .schema .asset_attachment import AttachmentType
88from labelbox .schema .dataset import Dataset
99from labelbox .schema .internal .descriptor_file_creator import DescriptorFileCreator
10+ from labelbox .schema .data_row import DataRow
1011
1112
1213@pytest .fixture
@@ -119,6 +120,11 @@ def test_create_is_empty():
119120 id = {}, payload = {"row_data" : "http://my_site.com/photos/img_01.jpg" })
120121 assert not item .is_empty ()
121122
123+ item = DataRowCreateItem (
124+ id = {},
125+ payload = {DataRow .row_data : "http://my_site.com/photos/img_01.jpg" })
126+ assert not item .is_empty ()
127+
122128
123129def test_create_row_data_none ():
124130 items = [
You can’t perform that action at this time.
0 commit comments