Skip to content

fix filename length limit error#46771

Open
YoYoJa wants to merge 1 commit intomainfrom
jesli/fix0605
Open

fix filename length limit error#46771
YoYoJa wants to merge 1 commit intomainfrom
jesli/fix0605

Conversation

@YoYoJa
Copy link
Copy Markdown
Contributor

@YoYoJa YoYoJa commented May 6, 2026

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings May 6, 2026 23:19
@YoYoJa YoYoJa requested a review from a team as a code owner May 6, 2026 23:20
@github-actions github-actions Bot added the Evaluation Issues related to the client library for Azure AI Evaluation label May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the resiliency of inline-markdown image handling in azure-ai-evaluation by treating invalid/unresolvable local image references as plain text rather than raising, specifically covering OS/path edge cases (e.g., overly long filenames and embedded null bytes).

Changes:

  • Added unit tests covering filename-too-long and null-byte path scenarios for _inline_image and mixed-content parsing.
  • Updated _inline_image to catch OSError/ValueError during local path resolution and fall back to returning a text chunk instead of throwing.

Reviewed changes

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

File Description
sdk/evaluation/azure-ai-evaluation/tests/unittests/test_inline_image_fallback.py Adds regression tests for long/invalid local image paths and mixed-content parsing behavior.
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_legacy/prompty/_utils.py Makes _inline_image handle invalid/too-long paths gracefully by returning text instead of raising.
Comments suppressed due to low confidence (1)

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_legacy/prompty/_utils.py:447

  • This branch resolves Path/exists() up front, then local_to_base64() re-resolves the same path and performs another exists() check. Consider refactoring so the resolved Path is computed once (or so local_to_base64 accepts a Path) to avoid duplicate filesystem calls and duplicated path-resolution logic.
            return {"type": "text", "text": image}
        inlined_uri = local_to_base64(local_file, mime_type)

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

Labels

Evaluation Issues related to the client library for Azure AI Evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants