earthdaily / earthdaily-python-client

EarthDaily python client
https://earthdaily.github.io/earthdaily-python-client/
MIT License
13 stars 7 forks source link

AttributeError: 'function' object has no attribute 'NoItemsFoundError' #118

Closed robmarkcole closed 2 weeks ago

robmarkcole commented 3 weeks ago

A search that returns no results in an AttributeError which I assume is not intended:

eds.search(
    collections=COLLECTION,
    ids=['made-up-id'],
)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[35], line 1
----> 1 eda_cloud_mask_items = eds.search(
      2     collections=COLLECTION,
      3      ids=['made-up-id'],
      4 )

File ~/earthdaily-python-client/earthdaily/earthdatastore/parallel_search.py:210, in parallel_search.<locals>.wrapper(*args, **kwargs)
    208     items = _run_parallel_search(func, args, kwargs, dt_range, batch_days)
    209 else:
--> 210     items = func(*args, **kwargs)
    212 execution_time = np.round(time.time() - start_time, 3)
    213 logging.info(f"Search/load items: {execution_time}s")

File ~/earthdaily-python-client/earthdaily/earthdatastore/__init__.py:1253, in Auth.search(self, collections, intersects, bbox, post_query, prefer_alternate, add_default_scale_factor, assets, raise_no_items, batch_days, n_jobs, **kwargs)
   1251     items_collection = post_query_items(items_collection, post_query)
   1252 if len(items_collection) == 0 and raise_no_items:
-> 1253     raise parallel_search.NoItemsFoundError("No items found.")
   1254 return items_collection

AttributeError: 'function' object has no attribute 'NoItemsFoundError'
nkarasiak commented 2 weeks ago

Fixed since release v0.2.14 :)