You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Prakhar Sandhu (Jira)" <ji...@apache.org> on 2022/03/19 12:48:00 UTC

[jira] [Comment Edited] (SPARK-38601) AttributeError: module 'databricks.koalas' has no attribute 'DateOffset'

    [ https://issues.apache.org/jira/browse/SPARK-38601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17509262#comment-17509262 ] 

Prakhar Sandhu edited comment on SPARK-38601 at 3/19/22, 12:47 PM:
-------------------------------------------------------------------

Hi [~hyukjin.kwon] , 

I tried your suggestion but it throws the below error : 
{code:java}
File "C:\Users\abcd\Anaconda3\envs\oden1\lib\site-packages\databricks\koalas\base.py", line 374, in __sub__
    raise TypeError("datetime subtraction can only be applied to datetime series.")
TypeError: datetime subtraction can only be applied to datetime series.
{code}


was (Author: JIRAUSER286645):
Hi [~hyukjin.kwon] , 

I tried your suggestion but it throws the below error : 
{code:java}
// code placeholder

File "C:\Users\abcd\Anaconda3\envs\oden1\lib\site-packages\databricks\koalas\base.py", line 374, in __sub__
    raise TypeError("datetime subtraction can only be applied to datetime series.")
TypeError: datetime subtraction can only be applied to datetime series.

{code}

> AttributeError: module 'databricks.koalas' has no attribute 'DateOffset'
> ------------------------------------------------------------------------
>
>                 Key: SPARK-38601
>                 URL: https://issues.apache.org/jira/browse/SPARK-38601
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 3.0.0
>            Reporter: Prakhar Sandhu
>            Priority: Major
>
> I am working on replacing Pandas library to Koalas Library in my python repo in VS Code. But Koalas module does not seem to have DateOffset() module similar to what pandas has.
> I tried this :
> {code:java}
> import databricks.koalas as ks 
> kdf["date_col_2"] = kdf["date_col_1"] - ks.DateOffset(months=cycle_info_gap)
>  {code}
> It results in the below error :
> {code:java}
> AttributeError: module 'databricks.koalas' has no attribute 'DateOffset' {code}
> Is there any alternative for this in Koalas?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org