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

migration: allow updating internal metadata

parent 9e00e6e736f9
......@@ -129,7 +129,8 @@ class SnapshotMigrator:
'index_dtype': ts.index.dtype.str,
'value_dtype': ts.dtypes.str if not self.isstr else '|O'
print('chunks for serie {}: {}'.format(self.seriename, idx + 1))
......@@ -143,12 +143,16 @@ class TimeSerie(SeriesServices):
return meta
def update_metadata(self, cn, seriename, metadata):
def update_metadata(self, cn, seriename, metadata, internal=False):
assert isinstance(metadata, dict)
assert not set(metadata.keys()) & self.metakeys
assert internal or not set(metadata.keys()) & self.metakeys
meta = self.metadata(cn, seriename)
# remove al but internal stuff
newmeta = {key: meta[key] for key in self.metakeys}
newmeta = {
key: meta[key]
for key in self.metakeys
if meta.get(key) is not None
reg = self.schema.registry
sql = reg.update().where(
Supports Markdown
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