error - forecast pipeline: Can only use .dt accessor with datetimelike values #31

Closed
opened 2025-05-07 04:34:53 +00:00 by foefl · 3 comments
Owner
  • reported on: 05.05.2025
  • call to forecast pipeline with: company_ids = None, start_date: unknown

following log created:
2025-05-05 12:21:12.9612|Error|ID:41|Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Python.Runtime.PythonException: Can only use .dt accessor with datetimelike values File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\pandas\core\indexes\accessors.py", line 643, in __new__ raise AttributeError("Can only use .dt accessor with datetimelike values") File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\pandas\core\accessor.py", line 224, in __get__ accessor_obj = self._accessor(obj) ^^^^^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\pandas\core\generic.py", line 6299, in __getattr__ return object.__getattribute__(self, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\delta_barth\analysis\forecast.py", line 207, in _process_sales df_cust["jahr"] = df_cust[DATE_FEAT].dt.year ^^^^^^^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\delta_barth\analysis\forecast.py", line 436, in pipeline_sales_forecast pipe = _process_sales( ^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\delta_barth\pipelines.py", line 53, in pipeline_sales_forecast result = forecast.pipeline_sales_forecast( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ at Python.Runtime.PythonException.ThrowLastAsClrException() at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw) at Python.Runtime.PyObject.InvokeMethod(String name, PyTuple args, PyDict kw) at Python.Runtime.PyObject.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result) at CallSite.Target(Closure, CallSite, Object, List`1, Nullable`1) at dopt.DeltaBarth.Plugin.Umsatzprognose(List`1 firmaIds, Nullable`1 analyseBeginn) at Debas.Deleco.Server.FremdsystemIntegration.Extern.dopt.DoptConnection.UmsatzPrognoseErstellen(IServerUserContext userContext, VerkaufUmsatzPrognoseErstellenTyp prognoseTyp, List`1 firmaRefids, TimeSpan analyseZeitraum) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.FremdsystemIntegration.Extern\dopt\DoptConnection.cs:line 140 at Debas.Deleco.Server.FremdsystemIntegration.Services.dopt.DoptService.Put(VerkaufUmsatzPrognoseErstellenRequest request) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.FremdsystemIntegration.Services\dopt\DoptService.cs:line 33 at InvokeStub_DoptService.Put(Object, Span`1) at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) --- End of inner exception stack trace --- at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Debas.Deleco.Server.Infrastruktur.Requestbearbeitung.RequestHandler.RufeService(IRequest request, ServiceMethodType serviceMethod, IService service, ClientSession clientSession) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.Infrastruktur\Requestbearbeitung\RequestHandler.cs:line 357 at Debas.Deleco.Server.Infrastruktur.Requestbearbeitung.RequestHandler.Handle(IRequest request, ServiceMethodType serviceMethod, RequestMetaInfo requestInfo) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.Infrastruktur\Requestbearbeitung\RequestHandler.cs:line 106

- reported on: 05.05.2025 - call to forecast pipeline with: `company_ids = None`, `start_date: unknown` following log created: `` 2025-05-05 12:21:12.9612|Error|ID:41|Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Python.Runtime.PythonException: Can only use .dt accessor with datetimelike values File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\pandas\core\indexes\accessors.py", line 643, in __new__ raise AttributeError("Can only use .dt accessor with datetimelike values") File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\pandas\core\accessor.py", line 224, in __get__ accessor_obj = self._accessor(obj) ^^^^^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\pandas\core\generic.py", line 6299, in __getattr__ return object.__getattribute__(self, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\delta_barth\analysis\forecast.py", line 207, in _process_sales df_cust["jahr"] = df_cust[DATE_FEAT].dt.year ^^^^^^^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\delta_barth\analysis\forecast.py", line 436, in pipeline_sales_forecast pipe = _process_sales( ^^^^^^^^^^^^^^^ File "C:\entwicklung\trunk\build_output\deleco\server\extern\dopt\python\Lib\site-packages\delta_barth\pipelines.py", line 53, in pipeline_sales_forecast result = forecast.pipeline_sales_forecast( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ at Python.Runtime.PythonException.ThrowLastAsClrException() at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw) at Python.Runtime.PyObject.InvokeMethod(String name, PyTuple args, PyDict kw) at Python.Runtime.PyObject.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result) at CallSite.Target(Closure, CallSite, Object, List`1, Nullable`1) at dopt.DeltaBarth.Plugin.Umsatzprognose(List`1 firmaIds, Nullable`1 analyseBeginn) at Debas.Deleco.Server.FremdsystemIntegration.Extern.dopt.DoptConnection.UmsatzPrognoseErstellen(IServerUserContext userContext, VerkaufUmsatzPrognoseErstellenTyp prognoseTyp, List`1 firmaRefids, TimeSpan analyseZeitraum) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.FremdsystemIntegration.Extern\dopt\DoptConnection.cs:line 140 at Debas.Deleco.Server.FremdsystemIntegration.Services.dopt.DoptService.Put(VerkaufUmsatzPrognoseErstellenRequest request) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.FremdsystemIntegration.Services\dopt\DoptService.cs:line 33 at InvokeStub_DoptService.Put(Object, Span`1) at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) --- End of inner exception stack trace --- at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Debas.Deleco.Server.Infrastruktur.Requestbearbeitung.RequestHandler.RufeService(IRequest request, ServiceMethodType serviceMethod, IService service, ClientSession clientSession) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.Infrastruktur\Requestbearbeitung\RequestHandler.cs:line 357 at Debas.Deleco.Server.Infrastruktur.Requestbearbeitung.RequestHandler.Handle(IRequest request, ServiceMethodType serviceMethod, RequestMetaInfo requestInfo) in C:\entwicklung\trunk\deleco\Dotnet\Debas.Deleco.Server.Infrastruktur\Requestbearbeitung\RequestHandler.cs:line 106 ``
foefl added the
bug
label 2025-05-07 04:34:53 +00:00
foefl self-assigned this 2025-05-07 04:34:53 +00:00
foefl added this to the bug fixes project 2025-05-07 04:34:53 +00:00
foefl moved this to To Do in bug fixes on 2025-05-07 04:35:03 +00:00
foefl moved this to In Progress in bug fixes on 2025-05-07 04:56:58 +00:00
Author
Owner
  • error caused by faulty data points with dates in future
  • these are not representable with default resolution in Pandas (nanoseconds)

image.png

- error caused by faulty data points with dates in future - these are not representable with default resolution in Pandas (nanoseconds) ![image.png](/attachments/719869f2-56fb-4438-8eea-13ea9e4a1146)
Author
Owner

Provided to solution strategies to Delta Barth:

  1. Implementing check for date data: Do datapoints exist which have timestamps from the future
  2. Delta Barth ensures that data can not contain dates from the future

To 1. two options were proposed:

  • ignore these points if they exist
  • cancel the whole pipeline execution and return an appropriate error message
Provided to solution strategies to Delta Barth: 1. Implementing check for date data: Do datapoints exist which have timestamps from the future 2. Delta Barth ensures that data can not contain dates from the future To 1. two options were proposed: - ignore these points if they exist - cancel the whole pipeline execution and return an appropriate error message
Author
Owner

add Option to filter non-relevant data points

procedure:

  • transform date entry columns to Pandas timestamp
  • coerce errors and filter out entries with corresponding NaT values
  • procede further...
**add Option to filter non-relevant data points** procedure: - transform date entry columns to Pandas timestamp - coerce errors and filter out entries with corresponding `NaT` values - procede further...
foefl closed this issue 2025-05-14 07:14:34 +00:00
foefl moved this to Done in bug fixes on 2025-05-14 07:15:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: delta-barth/delta-barth-py#31
No description provided.