stix2arango 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of stix2arango might be problematic. Click here for more details.

@@ -451,15 +451,20 @@ class Stix2Arango:
451
451
  )
452
452
 
453
453
  self.alter_objects(objects)
454
- with self.arango.transactional(exclusive=[self.core_collection_edge, self.core_collection_vertex]):
455
- inserted_object_ids, existing_objects = (
456
- self.arango.insert_relationships_chunked(
457
- objects, self.object_key_mapping, self.core_collection_edge
454
+ inserted_object_ids = []
455
+ existing_objects = {}
456
+ for chunk in utils.chunked(objects, 20_000):
457
+ with self.arango.transactional(exclusive=[self.core_collection_edge, self.core_collection_vertex]):
458
+ inserted, existing = (
459
+ self.arango.insert_relationships_chunked(
460
+ chunk, self.object_key_mapping, self.core_collection_edge
461
+ )
458
462
  )
459
- )
460
- self.arango.update_is_latest_several_chunked(
461
- inserted_object_ids, self.core_collection_edge, self.core_collection_edge
462
- )
463
+ inserted_object_ids.extend(inserted)
464
+ existing_objects.update(existing)
465
+ self.arango.update_is_latest_several_chunked(
466
+ inserted_object_ids, self.core_collection_edge, self.core_collection_edge
467
+ )
463
468
  return inserted_object_ids, existing_objects
464
469
 
465
470
  def import_default_objects(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stix2arango
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: stix2arango is a command line tool that takes a group of STIX 2.1 objects in a bundle and inserts them into ArangoDB. It can also handle updates to existing objects in ArangoDB imported in a bundle.
5
5
  Project-URL: Homepage, https://github.com/muchdogesec/stix2arango
6
6
  Project-URL: Issues, https://github.com/muchdogesec/stix2arango/issues
@@ -7,10 +7,10 @@ stix2arango/services/arangodb_service.py,sha256=mXBQUeKR9IHErmvuZ73AiASZKawZOpuR
7
7
  stix2arango/services/version_annotator.py,sha256=Sd1MIaXzK0fpNopNxRoB_3etodzAjX5D_p3uGQSWzOI,2946
8
8
  stix2arango/stix2arango/__init__.py,sha256=OqxWEEsHqR1QQpznM5DbFJ5bO5numKYtoYhjXYJMEyg,36
9
9
  stix2arango/stix2arango/bundle_loader.py,sha256=qi-0E_bMIMPZXzISvjhrWX8K-f7iFv9vOekldOGVczU,4603
10
- stix2arango/stix2arango/stix2arango.py,sha256=AWObgUYS1rc1XpR1qgH1PhBMO_kQg2JcqlVzw08_fzY,20559
10
+ stix2arango/stix2arango/stix2arango.py,sha256=UVv1OVy_BzqXYN9cWzjKK3QUSRuS-7jf3n_IgGQwx_8,20769
11
11
  stix2arango/templates/marking-definition.json,sha256=0q9y35mUmiF6xIWSLpkATL4JTHGSCNyLbejqZiQ0AuE,3113
12
- stix2arango-1.0.1.dist-info/METADATA,sha256=JWUiWOqhJXzl6bOaLtR2LZYHVOR52eYnTx1o9Z-uAIQ,6873
13
- stix2arango-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- stix2arango-1.0.1.dist-info/entry_points.txt,sha256=k2WnxMsHFLoyC6rqfvjhIMS1zwtWin51-MbNCGmSMYE,58
15
- stix2arango-1.0.1.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
16
- stix2arango-1.0.1.dist-info/RECORD,,
12
+ stix2arango-1.0.2.dist-info/METADATA,sha256=uuH8tlqansoJvxNkqCxf4h_h1MteaRUQIlSQQG2DNOA,6873
13
+ stix2arango-1.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
+ stix2arango-1.0.2.dist-info/entry_points.txt,sha256=k2WnxMsHFLoyC6rqfvjhIMS1zwtWin51-MbNCGmSMYE,58
15
+ stix2arango-1.0.2.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
16
+ stix2arango-1.0.2.dist-info/RECORD,,