# Does fido.search still support the "and" and "or" operations?

**URL:** <https://community.openastronomy.org/t/does-fido-search-still-support-the-and-and-or-operations/386>\
**Category:** SunPy\
**Tags:** sunpy, astropy, question\
**Created:** [July 3, 2022, 8:02pm UTC](https://community.openastronomy.org/t/does-fido-search-still-support-the-and-and-or-operations/386 "2022-07-03T20:02:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![azim](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@azim](https://community.openastronomy.org/u/azim)\
**Post date:** [July 3, 2022, 8:02pm UTC](https://community.openastronomy.org/t/does-fido-search-still-support-the-and-and-or-operations/386/1 "2022-07-03T20:02:25Z")

</div>

Following the example in Sunpy ([link](https://docs.sunpy.org/en/stable/generated/api/sunpy.net.fido_factory.UnifiedDownloaderFactory.html#sunpy.net.fido_factory.UnifiedDownloaderFactory.search)), I created this search query:

Here is my code

```auto
attrs_time = a.Time('2015/01/01 00:00', '2015/01/01 00:59')
search_mh = a.Instrument.maunaloa & a.Physobs.intensity
search_bh = a.Instrument.bigbear & a.Physobs.intensity

result = Fido.search(attrs_time, search_mh | search_bh, a.Sample(10*u.minute))

```

But it seems that when there is 0 result for one of the search queries, the OR operation throws an error. In the above case, `search_bh` finds no results and as a result I get this error (python 3.8):

* * *

```auto
TypeError Traceback (most recent call last)
Input In [53], in <cell line: 10>()
      7 search_lh = a.Instrument.learmonth & a.Physobs.intensity
      9 # result = Fido.search(attrs_time, search_mh)
---> 10 result = Fido.search(attrs_time, search_mh | search_bh, a.Sample(10*u.minute))

File ~/CODES/PyCode/mleco-datacollection/venv/lib/python3.8/site-packages/sunpy/net/fido_factory.py:322, in UnifiedDownloaderFactory.search(self, *query)
    320 for vres in vso_results:
    321 if len(vres) == 0:
--> 322 results.remove(vres)
    324 return UnifiedResponse(*results)

File ~/CODES/PyCode/mleco-datacollection/venv/lib/python3.8/site-packages/astropy/table/table.py:3426, in Table. __eq__ (self, other)
   3425 def __eq__ (self, other):
-> 3426 return self._rows_equal(other)

File ~/CODES/PyCode/mleco-datacollection/venv/lib/python3.8/site-packages/astropy/table/table.py:3474, in Table._rows_equal(self, other)
   3472 result = (self.as_array() == other.data) & (other.mask == false_mask)
   3473 else:
-> 3474 result = self.as_array() == other
   3476 return result

TypeError: Cannot compare structured or void to non-void arrays.

```

The documentation does not specify anything that can help.  
Can anyone please suggest a work around or tell me what the correct implementation would look like?

---

<div class="post-metadata">

**Author:** ![Cadair](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/cadair/32/422_2.png) [@Cadair](https://community.openastronomy.org/u/Cadair)\
**Post date:** [July 3, 2022, 8:42pm UTC](https://community.openastronomy.org/t/does-fido-search-still-support-the-and-and-or-operations/386/2 "2022-07-03T20:42:35Z")

</div>

You have run into this bug: [Error removing Fido results in gallery examples · Issue #6300 · sunpy/sunpy · GitHub](https://github.com/sunpy/sunpy/issues/6300)

The quickest solution would be to downgrade your numpy version until there is a released fix (either in sunpy or astropy).

---

<div class="post-metadata">

**Author:** ![nabobalis](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/nabobalis/32/14_2.png) [@nabobalis](https://community.openastronomy.org/u/nabobalis)\
**Post date:** [July 8, 2022, 6:36pm UTC](https://community.openastronomy.org/t/does-fido-search-still-support-the-and-and-or-operations/386/3 "2022-07-08T18:36:08Z")

</div>

This should now be fixed in the latest version of sunpy 4.0.3

If you can update and see if that resolves that error, I would be much appericated.
