Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError trying to open pandas.DateOffset objects in Variable Explorer #6729

Closed
CAM-Gerlach opened this issue Mar 12, 2018 · 0 comments
Closed

Comments

@CAM-Gerlach
Copy link
Member

Problem Description

When attempting to open a ``pandas.DateOffset object in the Variable Explorer, a ValueError is raised. We may not officially support all pandas (or arbitrary) datatypes until Spyder 4, but this should at least be handled more gracefully.

What steps will reproduce the problem?

  1. Create a DateOffset object
test_dateoffset = pd.DateOffset()
  1. Attempt to open it in a CollecitonsEditor by double clicking it in Variable Explorer.

  2. The error then occurs.

Traceback

Opening DateOffset error:

   File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 528, in createEditor
    readonly=readonly)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 1339, in setup
    remote=remote)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 1287, in __init__
    title)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 1164, in __init__
    minmax=minmax)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 121, in __init__
    self.set_data(data)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 169, in set_data
    self.set_size_and_type()
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 189, in set_size_and_type
    for index in range(start, stop) ]
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 189, in <listcomp>
    for index in range(start, stop) ]
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 86, in __getitem__
    attribute_toreturn = getattr(self.__obj__, key)
  File "C:\Anaconda3\envs\spyder-dev\lib\site-packages\pandas\tseries\offsets.py", line 530, in nanos
    raise ValueError("{name} is a non-fixed frequency".format(name=self))
ValueError: <DateOffset> is a non-fixed frequency

Package Versions

  • Spyder 3.2.7
  • Python 3.6.4
  • Qt 5.6.2
  • PyQt5 5.6
  • Windows 8.1

Dependencies

pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.22.0 (OK)
numpy >=1.7      :  1.14.0 (OK)
sphinx >=0.6.6   :  1.7.1 (OK)
rope >=0.9.4     :  0.10.7 (OK)
jedi >=0.9.0     :  0.11.1 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.27.3 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.2.1 (OK)
pylint >=0.25    :  1.8.2 (OK)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant