sunpy / drms

Access HMI, AIA and MDI data with Python from public JSOC DRMS servers
https://docs.sunpy.org/projects/drms/en/stable/
BSD 2-Clause "Simplified" License
22 stars 23 forks source link

pandas warnings #72

Closed dstansby closed 2 years ago

dstansby commented 2 years ago

Describe the bug

In sunpy we're getting a bunch of warnings that look like this, and are coming from drms:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.14/x64/lib/python3.9/doctest.py", line 1334, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest jsoc.rst[4]>", line 1, in <module>
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/sunpy/net/fido_factory.py", line 312, in search
    results = query_walker.create(query, self)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/sunpy/net/attr.py", line 613, in create
    return self.createmm(self, *args, **kwargs)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/sunpy/util/functools.py", line 18, in wrapper
    return dispatcher.dispatch(args[1].__class__)(*args, **kwargs)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/sunpy/net/fido_factory.py", line 241, in _create_and
    return factory._make_query_to_client(*query.attrs)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/sunpy/net/fido_factory.py", line 484, in _make_query_to_client
    results.append(tmpclient.search(*query, **kwargs))
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/sunpy/net/jsoc/jsoc.py", line 304, in search
    return_results = astropy.table.vstack([return_results, self._lookup_records(iargs)])
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/sunpy/net/jsoc/jsoc.py", line 763, in _lookup_records
    result = client.query(ds, key=key, rec_index=isMeta)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/drms/client.py", line 1073, in query
    self._convert_numeric_keywords(ds, res_key, skip_conversion)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/drms/client.py", line 653, in _convert_numeric_keywords
    kdf.loc[idx, k] = kdf.loc[idx, k].map(lambda x: int(x, base=16))
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/pandas/core/indexing.py", line 819, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/pandas/core/indexing.py", line 1796, in _setitem_with_indexer
    self._setitem_with_indexer_split_path(indexer, value, name)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/pandas/core/indexing.py", line 1839, in _setitem_with_indexer_split_path
    self._setitem_single_column(ilocs[0], value, pi)
  File "/home/runner/work/sunpy/sunpy/.tox/py39-online/lib/python3.9/site-packages/pandas/core/indexing.py", line 2024, in _setitem_single_column
    warnings.warn(
FutureWarning: In a future version, `df.iloc[:, i] = newvals` will attempt to set the values inplace instead of always setting a new array. To retain the old behavior, use either `df[df.columns[i]] = newvals` or, if columns are non-unique, `df.isetitem(i, newvals)`
/home/runner/work/sunpy/sunpy/docs/guide/acquiring_data/jsoc.rst:60: UnexpectedException

To Reproduce

import sunpy

sunpy.map.Map(...) etc

Screenshots

No response

System Details

No response

Installation method

No response

dstansby commented 2 years ago

@nabobalis as per https://github.com/sunpy/drms/pull/73#issuecomment-1266183866 could you re-open this?

dstansby commented 2 years ago

I think we're actually seeing https://github.com/pandas-dev/pandas/issues/48673 with this