tsio/replace: return en empty series rather than None (to mirror .update)
2 files changed, 12 insertions(+), 2 deletions(-)

M test/test_tsio.py
M tshistory/tsio.py
M test/test_tsio.py +10 -1
@@ 1780,10 1780,12 @@ def test_replace(engine, tsh):
         index=index[1:]
     )
 
-    tsh.replace(
+    d = tsh.replace(
         engine, seriesa, 'replaceme', 'Babar',
         insertion_date=utcdt(2019, 1, 1)
     )
+    assert len(d) == 3
+
     ival = tsh.interval(engine, 'replaceme')
     assert ival.left == pd.Timestamp('2020-01-01 00:00:00+0000', tz='UTC')
     assert ival.right == pd.Timestamp('2020-01-03 00:00:00+0000', tz='UTC')

          
@@ 1834,6 1836,13 @@ 2019-01-03 00:00:00+00:00  2020-01-02 00
     assert ival.left == pd.Timestamp('2020-01-02 00:00:00+0000', tz='UTC')
     assert ival.right == pd.Timestamp('2020-01-02 00:00:00+0000', tz='UTC')
 
+    d = tsh.replace(
+        engine, pd.Series(), 'replaceme', 'Arthur',
+        insertion_date=utcdt(2019, 1, 3)
+    )
+    assert len(d) == 0
+
+
 
 def test_replace_reuse(engine, tsh):
     index = pd.date_range(

          
M tshistory/tsio.py +2 -1
@@ 105,7 105,8 @@ class timeseries:
         """
         newts = newts.dropna()
         if not len(newts):
-            return
+            return pd.Series(dtype=newts.dtype)
+
         newts = self._guard_insert(
             newts, name, author, metadata,
             insertion_date