Skip to content

pandas warnings #72

@dstansby

Description

@dstansby

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions