You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def_coerce_to_period(x, freq=None):
ifisinstance(x, pd.Timestamp) andfreqisNone:
freq=x.freqraiseValueError(
"_coerce_to_period requires freq argument to be passed if x is pd.Timestamp"
)
it is never called without a freq argument and its a private method, and then it raises an error, so not sure what freq=x.freq is meant to do
Steps/Code to reproduce the bug
from aeon.forecasting.base._fh import _coerce_to_period
import pandas as pd
import pytest
timestamp = pd.Timestamp("2022-01-01")
result = _coerce_to_period(timestamp)
Expected results
freq = x.freq
Actual results
File "C:\Code\aeon\aeon\local\debug.py", line 35, in <module>
result = _coerce_to_period(timestamp)
File "C:\Code\aeon\aeon\forecasting\base\_fh.py", line 792, in _coerce_to_period
freq = x.freq
AttributeError: 'Timestamp' object has no attribute 'freq'
Versions
No response
The text was updated successfully, but these errors were encountered:
TonyBagnall
changed the title
[BUG] _coerce_to_period fails when not passed a freq argumeny
[BUG] _coerce_to_period fails when not passed a freq argument
Mar 27, 2024
Isn't the freq=None argument meant to be used when x is a series or a dataframe ? In which case, x.freq do make sense. But if it is never used, as it is a private function, I also see no use of it.
Describe the bug
whilst writing tests noticed that this fails
it is never called without a freq argument and its a private method, and then it raises an error, so not sure what freq=x.freq is meant to do
Steps/Code to reproduce the bug
Expected results
freq = x.freq
Actual results
Versions
No response
The text was updated successfully, but these errors were encountered: