can not get error logs when running with async_=True

Open
#482 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start by tracing the cursor.execute(async_=True), poll(), and fetch_logs() flow shown in the issue, then reproduce a failed query with asynchronous execution. Done means fetch_logs() returns the server's error information instead of an empty list.

Written by the indexing model from the issue text.

Description

I am running pyhive cursor.execute with async_=True, but when my query got error and I tried to get error message with cursor.fetch_logs() it returned an empty list. Did i do anything wrong, here is my code:

cursor.execute(sql_query, async_=True)

while True:
    # Get operation status
    status_code = cursor.poll().operationState
    status_name = OPERATION_STATES.get(status_code, f'UNKNOWN_STATE_{status_code}')
    
    _logger.info("Query status: %s", status_name)
    
    if status_code in [2, 3, 4]:
        _logger.info("Query completed with status: %s", status_name)
        break
    elif status_code == 5:
        error_message = cursor.fetch_logs()
        _logger.info("Query failed with error: %s", error_message)
        raise Exception(f"Query failed: {error_message}")
Dominant language
Python
Stars
1.7k
Forks
545
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dropbox/PyHive

All issues in dropbox/PyHive

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.