Skip to content
Snippets Groups Projects
Commit d920a8dd authored by Bert Palm's avatar Bert Palm 🎇
Browse files

Fix gl333

parent ea7f430d
No related branches found
No related tags found
6 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!501Release 2.1,!475Fix gl333
......@@ -14,7 +14,7 @@ from typing_extensions import Literal
import numpy as np
import pandas as pd
from dios import DictOfSeries
from dios import DictOfSeries, DtItype
from saqc.constants import *
from saqc.core import register, Flags
......@@ -331,6 +331,11 @@ def resample(
"""
datcol = data[field]
# workaround for #GL-333
if datcol.empty and data.itype in [None, DtItype]:
datcol = pd.Series(index=pd.DatetimeIndex([]), dtype=datcol.dtype)
freq = evalFreqStr(freq, freq_check, datcol.index)
datcol = aggregate2Freq(
......
......@@ -10,6 +10,8 @@
# see test/functs/fixtures.py for global fixtures "course_..."
import pytest
import pandas as pd
import saqc
import dios
from saqc.constants import *
......@@ -141,3 +143,9 @@ def test_offsetCorrecture():
flags = initFlagsLike(data)
data, _ = correctOffset(data, "dat", flags, 40, 20, "3d", 1)
assert (data == 0).all()[0]
# GL-333
def test_resampleSingleEmptySeries():
qc = saqc.SaQC(pd.DataFrame(1, columns=["a"], index=pd.DatetimeIndex([])))
qc.resample("a", freq="1d")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment