Skip to content

Commit

Permalink
MNT: use .insert_one as insert was removed from PyMongo v4
Browse files Browse the repository at this point in the history
 * same concept as used for conftrak
  • Loading branch information
JunAishima committed Jan 27, 2022
1 parent 15e3a5b commit 3099d3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions analysisstore/server/astore.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def insert_analysis_header(self, time, uid, provenance, **kwargs):
Unique identifier of the document inserted
"""
doc = dict(time=time, uid=uid, provenance=provenance, **kwargs)
self.database.analysis_header.insert(doc)
self.database.analysis_header.insert_one(doc)
return uid

def insert_data_reference_header(self, time, uid, analysis_header,
Expand Down Expand Up @@ -145,7 +145,7 @@ def insert_data_reference_header(self, time, uid, analysis_header,
doc = dict(time=time, uid=uid, analysis_header=analysis_header,
data_keys=data_keys,
**kwargs)
self.database.data_reference_header.insert(doc)
self.database.data_reference_header.insert_one(doc)
return uid

def bulk_data_reference_insert(self, data_header, data_references):
Expand Down Expand Up @@ -185,7 +185,7 @@ def insert_data_reference(self, time, uid, data_reference_header,
dhdr = self.doc_or_uid_to_uid(data_reference_header)
doc = dict(time=time, uid=uid, data_reference_header=dhdr,
data=data, timestamps=timestamps, **kwargs)
self.database.data_reference.insert(doc)
self.database.data_reference.insert_one(doc)
return uid

def insert_analysis_tail(self, time, uid, analysis_header, exit_status,
Expand Down Expand Up @@ -213,7 +213,7 @@ def insert_analysis_tail(self, time, uid, analysis_header, exit_status,
hdr = self.doc_or_uid_to_uid(analysis_header)
doc = dict(time=time, uid=uid, analysis_header=analysis_header,
exit_status=exit_status, **kwargs)
self.database.analysis_tail.insert(doc)
self.database.analysis_tail.insert_one(doc)
return uid

def _clean_ids(self, cursor):
Expand Down

0 comments on commit 3099d3f

Please sign in to comment.