Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions databricks/koalas/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@
from functools import partial, reduce
import sys
from itertools import zip_longest
from typing import Any, Optional, List, Tuple, Union, Generic, TypeVar, Iterable, Dict, Callable
from typing import (
Any,
Callable,
Dict,
Optional,
Generic,
Iterable,
List,
Tuple,
TYPE_CHECKING,
TypeVar,
Union,
)

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -304,6 +316,9 @@

T = TypeVar("T")

if TYPE_CHECKING:
from pandas.core.frame import DataFrame as Pandas_DataFrame


def _create_tuple_for_frame_type(params):
from databricks.koalas.typedef import NameTypeHolder
Expand Down Expand Up @@ -3976,7 +3991,7 @@ def duplicated(self, subset=None, keep="first"):
)
)

def to_koalas(self, index_col: Optional[Union[str, List[str]]] = None):
def to_koalas(self, index_col: Optional[Union[str, List[str]]] = None) -> "DataFrame":
"""
Converts the existing DataFrame into a Koalas DataFrame.

Expand Down Expand Up @@ -4250,7 +4265,7 @@ def to_spark(self, index_col: Optional[Union[str, List[str]]] = None):

to_spark.__doc__ = SparkFrameMethods.__doc__

def to_pandas(self):
def to_pandas(self) -> "Pandas_DataFrame":
"""
Return a pandas DataFrame.

Expand Down