GoogleCloudPlatform / python-docs-samples

Code samples used on cloud.google.com
Apache License 2.0
7.29k stars 6.38k forks source link

field_mask in process_document_ sample.py was deprecated #11447

Open fbukevin opened 4 months ago

fbukevin commented 4 months ago

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?

holtskinner commented 4 months ago

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