Open sergiocalde94 opened 2 years ago
Note: Lifetime version is 0.11.3
@sergiocalde94 thank you for reporting the bug. I can reproduce it locally with the latest Modin source. Here's the full stack trace:
We have had similar issues with other python packages that use pandas, e.g. plotly in #3211. We'll see if there's something we can do to address this bug.
@mvashishtha Any progress on this ?
@tianlinzx unfortunately not. Whenever someone is ready to start work on this issue, someone from modin-project/modin-contributors or modin-project/modin-core should assign them to this issue.
Would you please give this issue a higher priority ?
Meanwhile you can do this:
from modin.utils import to_pandas
summary_cal_holdout = calibration_and_holdout_data(to_pandas(transaction_data), 'id', 'date',
calibration_period_end='2014-09-01',
observation_period_end='2014-12-31' )
@tianlinzx I don't think there's any way to get compatibility by changing Modin. Modin objects can't figure out in what context they are being used. Workarounds like the one @vnlitvinov suggests will work for now, but will pay the performance penalty of converting Modin's objects to pandas, and will require changes everywhere you use problematic lifetimes
methods.
For a more comprehensive fix, lifetimes
will need to make sure that it never passes modin.pandas
objects to pandas
functions, and that it never uses both modin.pandas
objects and pandas
objects in a single function call. In the case of the stack trace in my comment here, the offending line in lifetimes
is transactions[datetime_col] = pd.to_datetime(transactions[datetime_col], format=datetime_format)
. That could be changed to something like:
col = transactions[datetime_col]
if isinstance(col, modin.pandas.Series):
lib = modin.pandas
else:
lib = pd
transactions[datetime_col] = lib.to_datetime(col, format=datetime_format)
I don't know where else the lifetimes
library would need to be changed to support modin.pandas
inputs everywhere.
@tianlinzx Would you be able to open a feature request for Modin support in the lifetimes
GitHub repo?
System information
Modin can't deal with Lifetimes
When using modin together with lifetimes it crashes :(. With pandas it works as expected.
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Thanks in advance for this awesome library! 🙌