Skip to content

Conversation

@pamelafox
Copy link
Collaborator

Purpose

We had a regression documented at #2825 where uploading a file caused an error. The error was in the begin_analyze_document call of Azure Document Intelligence, due to its inability to serialize the werkzerug FileStorage object. I'm not sure what caused this regression, as it doesn't look like we upgraded either package recently, but regardless, this is how I've fixed:

  • Always call content.read() to turn the input into bytes
  • Upgrade to latest document intelligence SDK so that we can use the documented parameters of begin_analyze_document (not necessary, but it's always good to move off an alpha)
  • Added tests that confirm that the DI SDK gets passed bytes

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[X] No

Does this require changes to learn.microsoft.com docs?

This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.

[ ] Yes
[X] No

Type of change

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

Code quality checklist

See CONTRIBUTING.md for more details.

  • The current tests all pass (python -m pytest).
  • I added tests that prove my fix is effective or that my feature works
  • I ran python -m pytest --cov to verify 100% coverage of added lines
  • I ran python -m mypy to check for type errors
  • I either used the pre-commit hooks or ran ruff and black manually on my code.

@pamelafox pamelafox merged commit 5edb536 into Azure-Samples:main Nov 12, 2025
21 checks passed
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.

2 participants