Skip to content

[FormRecognizer] Fix: StartRecognizeCustomFormsFromUri works when URI has blank space#12192

Merged
kinelski merged 6 commits intoAzure:masterfrom
kinelski:fr-space
May 25, 2020
Merged

[FormRecognizer] Fix: StartRecognizeCustomFormsFromUri works when URI has blank space#12192
kinelski merged 6 commits intoAzure:masterfrom
kinelski:fr-space

Conversation

@kinelski
Copy link
Contributor

Fixes #11564.

Adopted suggestion from #11564 (comment) and replaced every Uri.ToString() occurrence in the client with Uri.AbsoluteUri. Mock tests were added as well.

@kinelski kinelski marked this pull request as ready for review May 20, 2020 16:35
@kinelski kinelski self-assigned this May 20, 2020
@kinelski kinelski added Cognitive Services FormRecognizer Client This issue is related to a non-management package Docs labels May 20, 2020
- Custom form recognition without labels can now handle multipaged forms.
- `RecognizedForm.Pages` now only contains pages whose numbers are within `RecognizedForm.PageRange`.
- `FieldText.TextContent` cannot be `null` anymore, and it will be empty when no element is returned from the service.
- `FormRecognizerClient.StartRecognizeCustomFormsFromUri` now works with URIs that contain blank spaces, encoded or not.
Copy link
Member

Choose a reason for hiding this comment

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

I was looking at the keyvault changelog and noticed that they put the issue number next to the fixes.
After further look, found this in the guidance: https://github.com/Azure/azure-sdk/blob/2ef0280933f7e6859360c27912bc75e5a64b0bba/docs/policies/releases.md#changelog-guidance

Could you update this section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the first and last items. The second and third ones didn't have issues associated with them.

Assert.ThrowsAsync<ArgumentNullException>(() => client.StartTrainingAsync((Uri)null));
}

[Test]
Copy link
Member

Choose a reason for hiding this comment

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

following the patterns I've seen in another libraries, it will be good to move the mock tests into their own class.

Copy link
Contributor Author

@kinelski kinelski May 21, 2020

Choose a reason for hiding this comment

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

Personally I see no reason for treating mock tests differently since they are just non-live tests as well. I don't feel strongly about it, so let's follow the pattern from other libraries. We can easily revert it back if we think it's not the right choice in the future.

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

Labels

Client This issue is related to a non-management package Cognitive - Form Recognizer Cognitive Services Docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Getting error for FormRecognizerClient StartRecognizeCustomFormsFromUri for Azure SAS Uri

3 participants