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

Unable to use get query more than once #4

Open
1 of 4 tasks
ZenithClown opened this issue Oct 19, 2021 · 1 comment
Open
1 of 4 tasks

Unable to use get query more than once #4

ZenithClown opened this issue Oct 19, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ZenithClown
Copy link
Owner

ZenithClown commented Oct 19, 2021

Overview

Once the API.get() query is invoked, running the command for the second time throws IndexError.

Steps to Reproduce

  1. Import and define API object like:
import VisualCrossing as vc
api = vc.API("2021-09-25", APIKey = "my-key", location = "India")
data = api.get(ssl_verify = True) # this is executed
  1. Rerun data = api.get(ssl_verify = True)
  2. Error is received:
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-13-795283f69a4f> in <module>
----> 1 data = api.get(ssl_verify = True)
      2 data.head()

~/python/VisualCrossing/VisualCrossing/api.py in get(self, **kwargs)
    159         if type(self._location) != str:
    160             total = np.array([self._get_df_converted_data(loc, ssl_verify) for loc in self._location])
--> 161             code = set(total[:, 0])
    162             code = 200 if len(code) == 1 and list(code)[0] == 200 else list(code.discard(200))[0]
    163             data = pd.concat(total[:, 1])

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

System Information

> neofetch
             ...-:::::-...                 d-------@d--------
          .-MMMMMMMMMMMMMMM-.              ------------------ 
      .-MMMM`..-:::::::-..`MMMM-.          OS: Linux Mint 20.2 x86_64 
    .:MMMM.:MMMMMMMMMMMMMMM:.MMMM:.        Host: Inspiron 5558 01 
   -MMM-M---MMMMMMMMMMMMMMMMMMM.MMM-       Kernel: 5.4.0-89-generic 
 `:MMM:MM`  :MMMM:....::-...-MMMM:MMM:`    Uptime: 41 mins 
 :MMM:MMM`  :MM:`  ``    ``  `:MMM:MMM:    Packages: 2078 (dpkg) 
.MMM.MMMM`  :MM.  -MM.  .MM-  `MMMM.MMM.   Shell: zsh 5.8 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   Resolution: 1366x768 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM:MMM:   DE: Cinnamon 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   WM: Mutter (Muffin) 
.MMM.MMMM`  :MM:--:MM:--:MM:  `MMMM.MMM.   WM Theme: Cinnamox-Kashmir-Blue (Mint-Y-Dark) 
 :MMM:MMM-  `-MMMMMMMMMMMM-`  -MMM-MMM:    Theme: Mint-Y-Dark-Teal [GTK2/3] 
  :MMM:MMM:`                `:MMM:MMM:     Icons: Mint-Y-Dark-Teal [GTK2/3] 
   .MMM.MMMM:--------------:MMMM.MMM.      Terminal: gnome-terminal 
     '-MMMM.-MMMMMMMMMMMMMMM-.MMMM-'       CPU: Intel i5-5200U (4) @ 2.700GHz 
       '.-MMMM``--:::::--``MMMM-.'         GPU: Intel HD Graphics 5500 
            '-MMMMMMMMMMMMM-'              Memory: 2308MiB / 7872MiB 
               ``-:::::-``

Python Version : 3.8.8
Operating System : Linux
Desktop Environment : Gnome
VisualCrossing Version : 0.1.0-beta

List of Check's Required:

@ZenithClown ZenithClown added the bug Something isn't working label Oct 19, 2021
ZenithClown added a commit that referenced this issue Oct 19, 2021
* production testing
* known issue #4
@ZenithClown
Copy link
Owner Author

Same response in windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant