# Path: orangecontrib/spark/utils/data_utils.py
# def orange_to_pandas(dt):
#     fileIO = StringIO()
#     save_csv_IO(dt, fileIO, delimiter = ',')
#     pandas_data_frame = pd.read_csv(fileIO)
#     del fileIO
#     return pandas_data_frame


import pandas
from Orange.data import Table
from Orange.widgets import widget, gui, settings
from orangecontrib.spark.utils.data_utils import orange_to_pandas
__author__ = 'jamh'




class OWOrangeToPandas(widget.OWWidget):
    name = "to Pandas"
    description = "Convert Orange Table to Pandas DataFrame"
    icon = "../icons/orange-canvas.svg"

    inputs = [("Table", Table, "get_input", widget.Default)]
    outputs = [("Pandas", pandas.DataFrame, widget.Dynamic)]

# Path: orangecontrib/spark/utils/data_utils.py
# def orange_to_pandas(dt):
#     fileIO = StringIO()
#     save_csv_IO(dt, fileIO, delimiter = ',')
#     pandas_data_frame = pd.read_csv(fileIO)
#     del fileIO
#     return pandas_data_frame


# Path: orangecontrib/spark/widgets/data/orange_to_pandas.py
import pandas
from Orange.data import Table
from Orange.widgets import widget, gui, settings
from orangecontrib.spark.utils.data_utils import orange_to_pandas

__author__ = 'jamh'




class OWOrangeToPandas(widget.OWWidget):
    name = "to Pandas"
    description = "Convert Orange Table to Pandas DataFrame"
    icon = "../icons/orange-canvas.svg"

    inputs = [("Table", Table, "get_input", widget.Default)]
    outputs = [("Pandas", pandas.DataFrame, widget.Dynamic)]

    settingsHandler = settings.DomainContextHandler()