Commit ab9743cc authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

series/insert: move internal api the the private apis region

parent b0b330342302
......@@ -48,17 +48,6 @@ class timeseries(SeriesServices):
self.serie_tablename = {}
self.create_lock_id = sum(ord(c) for c in namespace)
def _guard_insert(self, newts):
assert isinstance(newts, pd.Series), 'Not a pd.Series'
assert not newts.index.duplicated().any(), 'There are some duplicates in the index'
assert newts.index.notna().all(), 'The index contains NaT entries'
if not newts.index.is_monotonic_increasing:
newts = newts.sort_index()
return num2float(newts)
@tx
def insert(self, cn, newts, seriename, author,
metadata=None,
......@@ -534,6 +523,16 @@ class timeseries(SeriesServices):
# creation / update
def _guard_insert(self, newts):
assert isinstance(newts, pd.Series), 'Not a pd.Series'
assert not newts.index.duplicated().any(), 'There are some duplicates in the index'
assert newts.index.notna().all(), 'The index contains NaT entries'
if not newts.index.is_monotonic_increasing:
newts = newts.sort_index()
return num2float(newts)
def _create(self, cn, newts, seriename, author, seriesmeta,
metadata=None, insertion_date=None):
start, end = start_end(newts, notz=False)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment