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

Running a search example #845

Closed
Sullumvoe opened this issue Jan 30, 2023 · 1 comment
Closed

Running a search example #845

Sullumvoe opened this issue Jan 30, 2023 · 1 comment
Labels

Comments

@Sullumvoe
Copy link

Expected behavior
I had expected the code to provide a listing of available IDs for the filter AOIs.

Actual behavior (describe the problem)
I received an error message " TypeError: object async_generator can't be used in 'await' expression
Related Issues
Please list the ticket numbers (e.g. #708) for any issues already logged in the system.

Workaround
Any ways you have found to work around the problem and accomplish your task.

Minimum, Complete, Viable Code Sample
A "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you.
See http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports

# Your python code here

or

> command-line-call

Environment Information

  • Operation System Information (python -c "import platform; print(platform.platform())") linux
  • Python version (python -c "import sys; print(sys.version.replace('\n', ' '))")3.10
  • Planet package version (planet -v)2

Installation Method

  • conda, pip wheel, from source, etc...conda for most pip for planet

Search the Data API

async with Session() as sess:
cl = DataClient(sess)
**items = await cl.run_search(search_id=request['id'])**
item_list = [i async for i in items]

async with Session() as sess:
cl = DataClient(sess)
items = await cl.run_search(search_id=request['id'])
item_list = [i async for i in items]
TypeError Traceback (most recent call last)
/tmp/ipykernel_48222/944137968.py in <cell line: 1>()
1 async with Session() as sess:
2 cl = DataClient(sess)
----> 3 items = await cl.run_search(search_id=request['id'])
4 item_list = [i async for i in items]

TypeError: object async_generator can't be used in 'await' expression

https://github.com/planetlabs/notebooks/blob/6cc220ff6db246353af4798be219ee1fe7e858b0/jupyter-notebooks/analysis-ready-data/ard_1_intro_and_best_practices.ipynb

@Sullumvoe Sullumvoe added the bug label Jan 30, 2023
@Sullumvoe Sullumvoe changed the title Running an search example Running a search example Jan 30, 2023
@jreiberkyle
Copy link
Contributor

This is a bug in the notebook and is logged at planetlabs/notebooks#233. To make it work, just drop the await.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants