Skip to content

fix: check all statuses in check_status to report errors properly - #730

Merged
luisremis merged 7 commits into
developfrom
fix/issue-165
May 23, 2026
Merged

fix: check all statuses in check_status to report errors properly#730
luisremis merged 7 commits into
developfrom
fix/issue-165

Conversation

@ad-claw000

Copy link
Copy Markdown
Contributor

Summary

  • Modifies `check_status` to iterate over all items in a list response and return the first error status if any.
  • This ensures `last_query_ok()` returns False when there are partial errors, reporting them properly rather than silently ignoring them or failing during blob handler parsing.

Verification

  • Verified logic manually. Tests are failing locally due to an unreachable test database (lenz:55551).

Fixes #165.

Copilot AI review requested due to automatic review settings May 21, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Connector.check_status() so last_query_ok() can correctly report failures when a multi-command response contains partial errors (previously only the first item was checked, allowing later errors to be missed).

Changes:

  • Iterate through all items in list/tuple responses and return the first negative status encountered.
  • Preserve prior behavior for all-nonnegative cases by returning the first command’s status.
Comments suppressed due to low confidence (2)

aperturedb/Connector.py:690

  • check_status’s docstring says it “Returns the status of the first command response”, but this change makes it scan all list items and return the first negative status encountered. Please update the docstring to match the new behavior (and consider fixing the typo “recieved” -> “received” while you’re there) so callers aren’t misled.
            for res in json_res:
                st = self.check_status(res)
                if st < 0:
                    return st
            if len(json_res) > 0:

aperturedb/Connector.py:689

  • This change modifies last_query_ok() behavior for multi-command responses (it can now fail on partial errors). There doesn’t appear to be unit coverage for check_status, and most Connector tests rely on an integration DB. Consider adding a small pure unit test that feeds a mixed-status list (e.g., first ok, later negative) into check_status / last_query_ok to lock in the expected behavior without requiring a live DB.
            for res in json_res:
                st = self.check_status(res)
                if st < 0:
                    return st

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread aperturedb/Connector.py Outdated
Copilot AI review requested due to automatic review settings May 21, 2026 15:25
@ad-claw000

Copy link
Copy Markdown
Contributor Author

Addressed the docstring update and added unit tests for check_status in test/test_Connector.py as suggested in the review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread aperturedb/Connector.py Outdated
Comment thread aperturedb/Connector.py
Comment thread test/test_Connector.py Outdated
Copilot AI review requested due to automatic review settings May 21, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Claw and others added 5 commits May 23, 2026 02:46
Copilot AI review requested due to automatic review settings May 23, 2026 02:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread aperturedb/Connector.py Outdated
@luisremis
luisremis merged commit a3e3931 into develop May 23, 2026
2 checks passed
@luisremis
luisremis deleted the fix/issue-165 branch May 23, 2026 16:05
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.

Response with large amount of blobs not reporting errors.

3 participants