Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

pd.read_csv() by default treats quotation marks as field delimiters and strips them. This caused custom evaluators to receive test when the CSV cell contained "test", making it impossible to distinguish quoted from unquoted values.

Changes

  • CSVDataFileLoader.load(): Add quoting=csv.QUOTE_NONE to preserve quotes as literal characters
  • Test coverage: Add test validating quote preservation across multiple scenarios

Example

response,ground_truth
test,"test"

Before: Custom evaluator receives both values as test (quotes stripped)
After: Custom evaluator receives test and "test" (quotes preserved)

This brings CSV behavior in line with JSONL handling, which already preserves quotes correctly.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • pypi.org
    • Triggering command: /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python3 python3 -m pip install pandas -q (dns block)
  • scanning-api.github.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>azure-ai-evaluation: creating custom code evaluator drops leading and trailing quotation marks in parameter column</issue_title>
<issue_description>- Package Name: azure-ai-evaluation

  • Package Version: 1.6.0
  • Operating System: windows
  • Python Version: 3.11.9

Describe the bug
If the value of a column starts AND ends with the quotation character (") the quotation characters are dropped when sent to the evaluator's custom python function.

If the value only starts or ends with a quotation mark, it is not dropped. It is only when it starts and ends with the quotation mark that the problem occurs.

Interestingly, the built in code evaluators (BLEU, F1 Score, GLEU and METEOR) all seem to be able to see that the result is not the same as the ground_truth so they must be receiving the leading and trailing quotation marks.

To Reproduce
Steps to reproduce the behavior:

  1. create a custom code evaluator to compare response and ground_truth
  2. prepare dataset, e.g: {"response":"test","ground_truth":"\"test\""}
  3. run the evaluator, the result always said response is equal with ground_truth

Expected behavior
The values sent to the parameters in the python function for a custom code evaluator should be exactly what they are in the dataset's cell with no characters stripped away.
Screenshots
If applicable, add screenshots to help explain your problem.

Image Image Image Image

Additional context
Add any other context about the problem here.
</issue_description>

Comments on the Issue (you are @copilot in this section)

@w-javed Team is working on the fix. We'll have a fix in upcoming release. Thanks!

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits December 29, 2025 21:26
Co-authored-by: luigiw <1483379+luigiw@users.noreply.github.com>
Co-authored-by: luigiw <1483379+luigiw@users.noreply.github.com>
Co-authored-by: luigiw <1483379+luigiw@users.noreply.github.com>
Co-authored-by: luigiw <1483379+luigiw@users.noreply.github.com>
Co-authored-by: luigiw <1483379+luigiw@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue dropping leading and trailing quotation marks Fix CSV quote stripping in custom evaluators Dec 29, 2025
Copilot AI requested a review from luigiw December 29, 2025 21:39
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.

azure-ai-evaluation: creating custom code evaluator drops leading and trailing quotation marks in parameter column

2 participants