Comments (2)
Hi @traed,
Thanks for sharing a code snippet. The snippet appears to work using the test values below.
import json
from google.cloud import discoveryengine_v1
doc_json = {
"title": "Test document title",
"body": "Test document description",
"categories": ["sports > clip","sports > highlight"],
"uri": "http://www.example.com",
}
document = discoveryengine_v1.Document()
document.json_data = json.dumps(doc_json)
client = discoveryengine_v1.DocumentServiceClient()
request = discoveryengine_v1.CreateDocumentRequest(
parent="projects/python-docs-samples-tests/locations/global/dataStores/<datastore>/branches/default_branch",
document_id="id",
document=document,
)
client.create_document(request=request)
I tried removing the document_id
argument of CreateDocumentRequest
as a test to check the error message and received the error message google.api_core.exceptions.InvalidArgument: 400 Field "document_id" is a required field, but no value is found. [detail: "document_id"
. I would expect there should be more detail besides 400 Request contains an invalid argument
. Please can you check whether the following results in more detailed error messages?
- Upgrade
google-api-core
by runningpip install --upgrade google-api-core
- Try using REST instead of gRPC in case the error message from REST is more detailed. As a quick check try using
client = discoveryengine_v1.DocumentServiceClient(transport="rest")
instead ofclient = discoveryengine_v1.DocumentServiceClient()
Please let me know if the above steps help provide more error information.
from google-cloud-python.
I'm going to close this issue as more information is needed to help troubleshoot but please feel free to open a new issue with more information.
from google-cloud-python.
Related Issues (20)
- Cloud Functions: test_iam_permissions returns 501 HOT 6
- google-cloud-monitoring tests depend on mock library which causes packaging problems on Fedora
- `prerelease_deps` nox session fails for google-cloud-gke-hub HOT 1
- Docs build is failing due to known issues in proto comments HOT 1
- Value Error for speech_v2: RecognitionConfig has no field as language_codes HOT 1
- Missing summaryWithMetadata google-cloud-discoveryengine HOT 2
- Warning: a recent release failed HOT 1
- Cyclical bug report guidance on secrets-manager client
- secret-manager client 2.18 incompatible with google-auth 2.24 HOT 4
- Warning: a recent release failed HOT 1
- some TextToSpeechAsyncClient methods return Any type HOT 6
- The code freezes without receiving a response or error when creating a Google Cloud Vision API client (vision.ImageAnnotatorClient) HOT 7
- Warning: a recent release failed HOT 1
- Configuration error for release-please
- Warning: a recent release failed
- discoveryenginev1: error on request above 100 gcsSource.inputUris HOT 2
- dimension for customEvent is not working HOT 9
- Support alpha and beta API access HOT 1
- Warning: a recent release failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-cloud-python.