-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
month_delta return incorrect value if passed a date object #84
Comments
thanks @pounde for the report could you include a reproducible example please? If I run
then I do indeed get an error
|
Apologies for not doing that from the start. I can't seem to replicate my code, nor can I replicate the code you posted. It is also worth noting that the object passed in the original issue was a 'date' object, not 'datetime'. I have updated the title to reflect that. While attempting to run the code you provided, I get: [line 22](vscode-notebook-cell:?execution_count=36&line=22)InvalidOperationError: Series month_delta, length 1 doesn't match the DataFrame height of 5
If you want expression: col("start_date")./usr/local/lib/python3.10/site-packages/polars_xdt/_internal.abi3.so:month_delta([2023-02-28]) to be broadcasted, ensure it is a scalar (for instance by adding '.first()'). Not sure why I didn't get this before, nor why it can't be broadcast. |
are you sure you got that while running the code I posted? could you post the full traceback please? |
I am attempting to replicate the functionality of relativedelta. The month_delta meets my current purposes but it return incorrect values if passed a date object.
This provided incorrect results. I would expect correct values or a ValueError
The following was my workaround:
The text was updated successfully, but these errors were encountered: