M test/test_api.py +11 -0
@@ 649,3 649,14 @@ def test_conflicting_update(mapi):
),
'Babar'
)
+
+ mapi.replace(
+ 'here-and-there',
+ pd.Series(
+ [1, 2, 3, 4],
+ index=pd.date_range(utcdt(2020, 1, 1), periods=4, freq='D')
+ ),
+ 'Babar'
+ )
+
+ # all allowed :)
M tshistory/api.py +7 -5
@@ 140,11 140,13 @@ class dbtimeseries:
"""
- # give a chance to say *no*
- self.othersources.forbidden(
- name,
- 'not allowed to replace to a secondary source'
- )
+ # check local existence
+ if not self.tsh.exists(self.engine, name):
+ # give a chance to say *no*
+ self.othersources.forbidden(
+ name,
+ 'not allowed to replace to a secondary source'
+ )
return self.tsh.replace(
self.engine,