3

I am pulling the data from Sql in python using:

df_sql = pd.read_sql_query('select * from table', conn)

which was working fine till now. today when i was installing some other packages using pip install, my pandas got reinstalled/updated too.

pd.__version__
Out[8]: '0.22.0'

Now when i run the above code i get error:

  File "C:\xxx\xxx\xxxx\xx\Continuum\anaconda3\lib\site-packages\pandas\core\dtypes\dtypes.py", line 697, in is_dtype
    #        return super(IntervalDtype, cls).all()

TypeError: super(type, obj): obj must be an instance or subtype of type

I even tried to fix this by following steps in the below mentioned link. still getting error

super(type, obj): obj must be an instance or subtype of type

Complete error:

df_sql = pd.read_sql_query('select * from table', conn)
Traceback (most recent call last):

  File "<ipython-input-9-f26429b805cd>", line 1, in <module>
    df_sql = pd.read_sql_query('select * from table', conn)

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 332, in read_sql_query
    parse_dates=parse_dates, chunksize=chunksize)

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 1458, in read_query
    parse_dates=parse_dates)

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 157, in _wrap_result
    coerce_float=coerce_float)

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\core\frame.py", line 1093, in from_records
    columns = _ensure_index(columns)

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 4212, in _ensure_index
    def _get_na_value(dtype):

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 205, in __new__
    if is_interval_dtype(data):

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\core\dtypes\common.py", line 475, in is_interval_dtype
    return IntervalDtype.is_dtype(arr_or_dtype)

  File "C:\xxx\xxxx\xxx\Local\Continuum\anaconda3\lib\site-packages\pandas\core\dtypes\dtypes.py", line 696, in is_dtype
    return super(IntervalDtype, cls).is_dtype(dtype)

TypeError: super(type, obj): obj must be an instance or subtype of type
BadRequest
  • 382
  • 1
  • 14
aim
  • 301
  • 1
  • 3
  • 10

0 Answers0