Skip to content

fix: tableToMarkdown IndexError when single-key dict value is empty list#43751

Open
MosheEichler wants to merge 5 commits intomasterfrom
fix/csp-tabletomarkdown-empty-list-indexerror
Open

fix: tableToMarkdown IndexError when single-key dict value is empty list#43751
MosheEichler wants to merge 5 commits intomasterfrom
fix/csp-tabletomarkdown-empty-list-indexerror

Conversation

@MosheEichler
Copy link
Copy Markdown
Contributor

@MosheEichler MosheEichler commented Mar 30, 2026

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

https://jira-dc.paloaltonetworks.com/browse/XSUP-66388

Description

issue: When tableToMarkdown is called with a single-key dict whose value is an empty list and no explicit headers, the function unpacks the dict value into t=[], then crashes with IndexError: list index out of range at t[0].
Fix: Only unpack the list value when it is non-empty.

Related PRs

It's a continuation of this PR

Must have

  • Tests
  • Documentation

When tableToMarkdown is called with a single-key dict whose value is an
empty list and no explicit headers, the function unpacks the dict value
into t=[], then crashes with IndexError: list index out of range at t[0].

Fix: only unpack the list value when it is non-empty.

Fixes XSUP-66388
@MosheEichler MosheEichler self-assigned this Mar 30, 2026
@MosheEichler MosheEichler requested a review from DeanArbel March 30, 2026 19:39
@MosheEichler MosheEichler added ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. release-notes-only Indicates that this pull request has ONLY release notes to review for documentation process labels Mar 30, 2026
@marketplace-ai-reviewer marketplace-ai-reviewer removed the ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. label Mar 30, 2026
@content-bot
Copy link
Copy Markdown
Contributor

🤖 AI-Powered Code Review Available

You can leverage AI-powered code review to assist with this PR!

Available Commands:

  • @marketplace-ai-reviewer start review - Initiate a full AI code review
  • @marketplace-ai-reviewer re-review - Incremental review for new commits

@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 Analysis started. Please wait for results...

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

Coverage

Tests Skipped Failures Errors Time
5663 89 💤 0 ❌ 0 🔥 4m 50s ⏱️

@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 AI Review Disclaimer

This review was generated by an AI-powered tool and may contain inaccuracies. Please be advised, and we extend our sincere apologies for any inconvenience this may cause.

Copy link
Copy Markdown
Contributor

@marketplace-ai-reviewer marketplace-ai-reviewer left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I've reviewed the changes and found a couple of minor adjustments needed. Specifically, the table formatting logic needs a slight tweak to properly return a "No entries." message for empty lists instead of an empty row, and the pack metadata is missing the vendor name in its keywords. Let me know if you have any questions about these updates!

Additionally, please address the following file-level notes:

  • Packs/Base/pack_metadata.json: The vendor name ('Cortex' or 'XSOAR') is missing from the keywords list. Please add it to improve searchability.

@DeanArbel please review and approve the results generated by the AI Reviewer by responding 👍 on this comment.

@MosheEichler MosheEichler added the ready-for-pipeline-running Whether the pr is ready for running the whole pipeline, including testing on SAAS machines label Mar 30, 2026
@MosheEichler MosheEichler marked this pull request as ready for review March 30, 2026 20:21
@MosheEichler MosheEichler enabled auto-merge (squash) March 30, 2026 20:21
MosheEichler and others added 2 commits March 31, 2026 13:20
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>
@content-bot
Copy link
Copy Markdown
Contributor

Validate summary
The following errors were thrown as a part of this pr: .
If the AG100 validation in the pre-commit GitHub Action fails, the pull request cannot be force-merged.

Verdict: PR can be force merged from validate perspective? ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-approved ready-for-pipeline-running Whether the pr is ready for running the whole pipeline, including testing on SAAS machines release-notes-only Indicates that this pull request has ONLY release notes to review for documentation process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants