@@ -168,7 +168,7 @@ def create_if_not_exists(
168168 self , data : "dict[str, Any]" , * , confirm : bool = False
169169 ) -> "tuple[Asset, bool]" :
170170 """
171- Creates an asset and associated locations and attachments if asset
171+ Creates an asset and associated attachments if asset
172172 does not already exist.
173173
174174 Args:
@@ -190,18 +190,6 @@ def create_if_not_exists(
190190 arc_serial_number: das-j1-01
191191 arc_description: Electronic door entry system to DataTrails France
192192 wavestone_asset_id: paris.france.datatrails.das
193- location:
194- identity: locations/xxxxxxxxxxxxxxxxxxxxxxxxxx
195- location:
196- selector:
197- - display_name
198- display_name: DataTrails Paris
199- description: Sales and sales support for the French region
200- latitude: 48.8339211,
201- longitude: 2.371345,
202- attributes:
203- address: 5 Parvis Alan Turing, 75013 Paris, France
204- wavestone_ext: managed
205193 attachments:
206194 - filename: functests/test_resources/doors/assets/entry-terminal.jpg
207195 content_type: image/jpg
@@ -210,12 +198,6 @@ def create_if_not_exists(
210198 The 'selector' value is required and will usually specify the 'arc_display_name' as a
211199 secondary key. The keys in 'selector' must exist in the attributes of the asset.
212200
213- If 'location' is specified then the 'selector' value is required and is used as a
214- secondary key. Likewise the secondary key must exist in the attributes of the location.
215-
216- Alternatively the identity of the location is specified - both
217- are shown - choose one.
218-
219201 Returns:
220202 tuple of :class:`Asset` instance, Boolean is True if asset already existed
221203
@@ -225,7 +207,6 @@ def create_if_not_exists(
225207 existed = False
226208 data = deepcopy (data )
227209 attachments = data .pop ("attachments" , None )
228- location = data .pop ("location" , None )
229210 selector = data .pop ("selector" ) # must exist
230211 props , attrs = selector_signature (selector , data )
231212 try :
@@ -240,16 +221,6 @@ def create_if_not_exists(
240221 LOGGER .info ("asset with selector %s,%s already exists" , props , attrs )
241222 return asset , True
242223
243- # is location present?
244- if location is not None :
245- if "identity" in location :
246- data ["attributes" ]["arc_home_location_identity" ] = location ["identity" ]
247- else :
248- loc , _ = self ._archivist .locations .create_if_not_exists (
249- location ,
250- )
251- data ["attributes" ]["arc_home_location_identity" ] = loc ["identity" ]
252-
253224 # any attachments ?
254225 if attachments is not None :
255226 for a in attachments :
0 commit comments