python-docs-samples icon indicating copy to clipboard operation
python-docs-samples copied to clipboard

field_mask in process_document_ sample.py was deprecated

Open fbukevin opened this issue 1 year ago • 1 comments

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/documentai/snippets/process_document_sample.py#L39

Did you change the file? If so, how?

No

Describe the issue

On line 39, the function declaration contains a parameter field_mask:

 field_mask: Optional[str] = None,

When I invoke the method and intent to pass field_mask, it turns out no result of document recognition without error. I look up to Google official document, it seems that the parameter field_mask was depreacted so it won't take effect?

fbukevin avatar Apr 15 '24 08:04 fbukevin

Can you clarify where it specifies that the field_mask parameter is deprecated?

In the Python Client Library docs, it doesn't say that it is. https://cloud.google.com/python/docs/reference/documentai/latest/google.cloud.documentai_v1.types.ProcessRequest#:~:text=field_mask,_name%7D.


The page that you linked is showing a different sample that just happens to not include that parameter, but it can be included.

https://cloud.google.com/document-ai/docs/process-documents-client-libraries?_ga=2.16145846.-1016138054.1713164866#client-libraries-usage-python

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/documentai/snippets/quickstart_sample.py

holtskinner avatar Apr 29 '24 17:04 holtskinner