Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integer indices in error reporting #1487

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

sfc-gh-melnacouzi
Copy link
Contributor

@sfc-gh-melnacouzi sfc-gh-melnacouzi commented Aug 26, 2024

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

When error location in Pydantic contains indices, it crashes with an error that can't be decyphired easily.
It crashes trying to join a mix of string and integers ".".join(e["loc"]).

This fixes it to report integers nicely: e.g. key1[1].key2

WIll add unit test as a follow up (to unblock the release)

@sfc-gh-melnacouzi sfc-gh-melnacouzi requested a review from a team as a code owner August 26, 2024 12:03
@sfc-gh-turbaszek sfc-gh-turbaszek merged commit 54e8d46 into main Aug 26, 2024
16 checks passed
@sfc-gh-turbaszek sfc-gh-turbaszek deleted the fix-pydantic-error-messaging branch August 26, 2024 12:26
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.

3 participants