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

Invalid comparison leads to "PENDING" state returning False #143

Closed
sserrata opened this issue Mar 25, 2020 · 0 comments · Fixed by #144
Closed

Invalid comparison leads to "PENDING" state returning False #143

sserrata opened this issue Mar 25, 2020 · 0 comments · Fixed by #144
Assignees
Labels
bug Something isn't working

Comments

@sserrata
Copy link
Member

Describe the bug

In the iter_job_results() method, an invalid comparison statement leads to "PENDING" state returning False.

Expected behavior

Both "RUNNING" and "PENDING" states should evaluate to True.

Current behavior

Currently, if a "PENDING" state returned by the Query Service API would evaluate to False, potentially resulting in a CortexError exception being thrown.

Possible solution

As proposed by @mishas, refactoring the comparison to elif r.json()["state"] in ("RUNNING", "PENDING") will allow both "RUNNING" and "PENDING" to evaluate to True.

Steps to reproduce

n/a

Screenshots

n/a

Context

n/a

Your Environment

  • Version used: cortex-data-lake-python alpha7
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): python 3.7.7
  • Operating System and version (desktop or mobile): desktop
  • Link to your project:
@sserrata sserrata added the bug Something isn't working label Mar 25, 2020
@sserrata sserrata self-assigned this Mar 25, 2020
@sserrata sserrata changed the title Invalid comparison leads to "PENDING" state returning False Invalid comparison leads to "PENDING" state returning False Mar 25, 2020
sserrata added a commit to sserrata/pan-cortex-data-lake-python that referenced this issue Mar 25, 2020
@sserrata sserrata mentioned this issue Mar 25, 2020
4 tasks
sserrata added a commit that referenced this issue Mar 25, 2020
* Update docstrings

* Fix for bug #143

* Bump version

* Update HISTORY.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant