Skip to content

GML-2083-TextFile-UnboundError : fix UnboundLocalError in community desc poll during rebuild#49

Open
prinskumar-tigergraph wants to merge 1 commit into
release_2.0.1from
GML-2083-TextFile-UnboundError
Open

GML-2083-TextFile-UnboundError : fix UnboundLocalError in community desc poll during rebuild#49
prinskumar-tigergraph wants to merge 1 commit into
release_2.0.1from
GML-2083-TextFile-UnboundError

Conversation

@prinskumar-tigergraph

@prinskumar-tigergraph prinskumar-tigergraph commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

User description

Return False and log full traceback when communities_have_desc (or embedding check) fails so the wait loop retries instead of crashing the rebuild TaskGroup.


PR Type

Bug fix


Description

  • Return false after polling failures

  • Validate polling responses before indexing

  • Log tracebacks for diagnostics


Diagram Walkthrough

flowchart LR
  A["Polling query"] -- "exception or malformed response" --> B["Log detailed error"]
  B -- "return False" --> C["Wait loop retries"]
  C -- "avoids crash" --> D["Rebuild continues safely"]
Loading

File Walkthrough

Relevant files
Bug fix
util.py
Harden rebuild polling error handling                                       

ecc/app/graphrag/util.py

  • Adds False returns after communities_have_desc query exceptions.
  • Adds False returns after vertices_have_embedding query exceptions.
  • Validates response shape before reading all_have_desc or
    all_have_embedding.
  • Logs full tracebacks and unexpected response payloads.
+24/-6   

Return False and log full traceback when communities_have_desc (or embedding check) fails so the wait loop retries instead of crashing the rebuild TaskGroup.
@tg-pr-agent

tg-pr-agent Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Type Validation

The new response handling validates presence of the expected keys but not that the returned values are booleans. A malformed truthy value such as a non-empty string could cause the wait loop to treat the rebuild as complete instead of retrying.

try:
    res = resp[0]["all_have_desc"]
except (IndexError, KeyError, TypeError) as e:
    logger.error(
        f"Check Vert Desc unexpected response {resp!r}: {e!r}"
    )
    return False

logger.info(res)
return res
Type Validation

The embedding poll result is returned directly after key lookup. Consider explicitly checking that all_have_embedding is a boolean to avoid malformed truthy values prematurely ending the wait loop.

try:
    res = resp[0]["all_have_embedding"]
except (IndexError, KeyError, TypeError) as e:
    logger.error(
        f"Check embedding rebuilt unexpected response {resp!r}: {e!r}"
    )
    return False

logger.info(resp)
return res

@tg-pr-agent

tg-pr-agent Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@prinskumar-tigergraph prinskumar-tigergraph changed the title GML-2083: fix UnboundLocalError in community desc poll during rebuild GML-2083-TextFile-UnboundError : fix UnboundLocalError in community desc poll during rebuild Jul 13, 2026
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

Successfully merging this pull request may close these issues.

2 participants