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

QDS Py package always has hc.status of 'waiting' #335

Open
eddyojb88 opened this issue Nov 16, 2020 · 1 comment
Open

QDS Py package always has hc.status of 'waiting' #335

eddyojb88 opened this issue Nov 16, 2020 · 1 comment

Comments

@eddyojb88
Copy link

eddyojb88 commented Nov 16, 2020

Following the example here: hc.status() invariably gives a status of 'waiting', even if the server has finished the result.

Please can you advise as to how we resolve this?

@chattarajoy
Copy link
Member

chattarajoy commented Nov 17, 2020

hc.status() returns a static value stored in the memory and doesn't make an API call. You'll need to refresh the object using HiveCommand.find(hc.id) or use hc.run() that will go into a loop until the command is finished.

Something like this:

while not Command.is_done(hc.status):
  time.sleep(Qubole.poll_interval)
  hc = HiveCommand.find(hc.id)

Checkout this block of code: https://github.com/qubole/qds-sdk-py/blob/unreleased/qds_sdk/commands.py#L153

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

No branches or pull requests

2 participants