databricks / koalas

Koalas: pandas API on Apache Spark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot import name '_is_url' from 'pandas.io.common' when using `ks.melt`

guilhermeparreira opened this issue · comments

Hi There!
I tried to reproduce the ks.melt function and it returns to me:

ImportError: cannot import name '_is_url' from 'pandas.io.common' (/databricks/python/lib/python3.8/site-packages/pandas/io/common.py)

It didn't happen in the morning, only after lunch... What Can I be doing wrong?

df = ks.DataFrame({'A': {0: 'a', 1: 'b', 2: 'c'},
                   'B': {0: 1, 1: 3, 2: 5},
                   'C': {0: 2, 1: 4, 2: 6}},
                  columns=['A', 'B', 'C'])
ks.melt(df)

ImportError                               Traceback (most recent call last)
/databricks/python/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj)
    343             method = get_real_method(obj, self.print_method)
    344             if method is not None:
--> 345                 return method()
    346             return None
    347         else:

/databricks/python/lib/python3.8/site-packages/databricks/koalas/usage_logging/__init__.py in wrapper(*args, **kwargs)
    178             start = time.perf_counter()
    179             try:
--> 180                 res = func(*args, **kwargs)
    181                 logger.log_success(
    182                     class_name, function_name, time.perf_counter() - start, signature

/databricks/python/lib/python3.8/site-packages/databricks/koalas/frame.py in _repr_html_(self)
  11039                 )
  11040                 return REPR_HTML_PATTERN.sub(footer, repr_html)
> 11041         return pdf.to_html(notebook=True, bold_rows=bold_rows)
  11042 
  11043     def __getitem__(self, key):

/databricks/python/lib/python3.8/site-packages/pandas/core/frame.py in to_html(self, buf, columns, col_space, header, index, na_rep, formatters, float_format, sparsify, index_names, justify, max_rows, max_cols, show_dimensions, decimal, bold_rows, classes, escape, notebook, border, table_id, render_links, encoding)
   2467         column_3    1000000 non-null object
   2468         dtypes: object(3)
-> 2469         memory usage: 188.8 MB
   2470         """
   2471 

/databricks/python/lib/python3.8/site-packages/pandas/io/formats/format.py in to_html(self, buf, encoding, classes, notebook, border)
    983     leading_space : bool, optional
    984         Whether the array should be formatted with a leading space.
--> 985         When an array as a column of a Series or DataFrame, we do want
    986         the leading space to pad between columns.
    987 

/databricks/python/lib/python3.8/site-packages/pandas/io/formats/html.py in <module>
     13 from pandas import option_context
     14 
---> 15 from pandas.io.common import _is_url
     16 from pandas.io.formats.format import (
     17     DataFrameFormatter,

ImportError: cannot import name '_is_url' from 'pandas.io.common' (/databricks/python/lib/python3.8/site-packages/pandas/io/common.py)

My pandas version is pandas==0.25.3 and koalas==1.6.0