qds-sdk-py
qds-sdk-py copied to clipboard
QDS Py package always has hc.status of 'waiting'
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?
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