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

[formrecognizer] Documentation implies Form Recognizer will return Key-Value Pairs that may lack keys and/or values #36892

Closed
edrogers opened this issue Aug 14, 2024 · 7 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@edrogers
Copy link

The documentation for Azure Form Recognizer includes example snippets on usage. (Many thanks to @kristapratico, @catalinaperalta, and @maririos for working to add those in #20996 and #29193!)

In those snippets is a pair of if-statements: if kv_pair.key: here and if kv_pair.value here. Is there any chance that either of kv_pair.key or kv_pair.value will come back "falsy" or missing?

If so, is there somewhere in the documentation that could help me understand the usage of key-value pairs that are missing either the key, the value, or both?

(On the other hand, if they'll never be missing, could those conditionals be removed?)

Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 14, 2024
@YalinLi0312
Copy link
Member

@edrogers Thanks for your contact!
This is the documentation of DocumentKeyValuePair class: https://learn.microsoft.com/en-us/python/api/azure-ai-formrecognizer/azure.ai.formrecognizer.documentkeyvaluepair?view=azure-python#attributes
key and confidence properties are required, value could be None.

@YalinLi0312 YalinLi0312 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Aug 20, 2024
Copy link

Hi @edrogers. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Aug 20, 2024
@edrogers
Copy link
Author

Ah, thanks for this clarification & link to the documentation @YalinLi0312!

So, this means the first if-statement is unnecessary (since key is a required property), but the second if-statement is important since kv_pair.value may be None. Is my understanding correct?

If so, would you be willing to review/accept a pull request that removes the first if-statement?

@github-actions github-actions bot added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Aug 20, 2024
@YalinLi0312
Copy link
Member

Hi @edrogers , sure thing, we would review your PR and welcome any contributions. Thanks in advance! One more thing you may don't know for this sample - you can update the sample_analyze_general_documents.py and use the snippet in README.md.

@YalinLi0312 YalinLi0312 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Hi @edrogers. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Sep 9, 2024
Copy link

Hi @edrogers, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Sep 17, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

2 participants