210 questions
0
votes
0
answers
230
views
BigQuery Client Load Table from URI in Python doesn't work but using Pandas does
I have an ETL process that executes as a cloud function that reads a csv from a cloud storage bucket and writes it to a BigQuery Table.
def gcs_to_table(uri,table_id,project_id):
logger.info(f'...
0
votes
0
answers
91
views
Dereference URLs in Google Cloud objects
I'm writing an application using the Google Cloud Python Client Libraries. Every so often, I encounter an object that references another via a URL. For example, the Zone object has a region field that ...
0
votes
0
answers
149
views
Query a collection by an array of document ids with python
I have list of ids I want to query from a collection.
If I use:
query = firebase_client.collection('my_collection').where(
field_path=field_path.FieldPath.document_id(), op_string='in', value=...
1
vote
1
answer
349
views
What should the 'parent' value be when calling Google's API keys client ListKeysRequest method?
I'm trying to use the google-cloud-api-keys package's ApiKeysClient to get a list of API keys in my project. What should the format of the parent parameter be?
I've tried using my project ID and ...
0
votes
1
answer
690
views
Upload PDF from Local to Document AI
I now create a web app and I want to ask about how to upload PDFs from my laptop/local to Document AI - Summarizer Processor?
with open(file_path, "rb") as image: image_content = image.read()...
1
vote
1
answer
351
views
Original File Name - GCP - Document AI
I'm using Document AI to perform OCR on some thousands of pdf documents with their python client.
I'm uploading them into a bucket, batch processing them and a .json output is generated in another ...
-1
votes
1
answer
349
views
Unable to get iam policy for a project's Artifact Registry in GCP using Python GCloud API
I'm trying to access the IAM permissions for the artifact registry of one of my projects through artifactregistry_v1 python API fro GCP.
name_val = "projects/" + REGISTRY_NAME
...
1
vote
0
answers
635
views
Set Iam Policy using Resource Manager Python V3 GCP API doesn't have a policy field?
I am trying to add service accounts to a certain role in a project in GCP. In order to do so, I get the IAM policy and then add the accounts desired, but am unable to get set_iam_policy to work ...
2
votes
1
answer
2k
views
Calling Google Cloud Speech to Text API regional recognizers, using Python Client library, showing error 400 and 404
The goal: The goal is to use Python client libraries to convert a speech audio file to text through a Chirp recognizer.
Steps to recreate the error: I'm creating a recognizer following the steps in ...
0
votes
1
answer
219
views
using time partitioning for bigquery load doesn't upload every row
I'm attempting to use the BigQuery python API client for uploading a large dataframe. The upload works however when specifying a time partition only some rows are uploaded. When time partitioning is ...
0
votes
1
answer
354
views
Google Cloud Storage Python API: blob rename, where is copy_to
I am trying to rename a blob (which can be quite large) after having uploaded them to a temporary location in the bucket.
Reading the documentation it says:
Warning: This method will first duplicate ...
3
votes
1
answer
3k
views
use different project for bigquery data than for the billing of queries
I'm currently querying a project (call it data_project) in bigquery through the python SDK.
For several reasons I want to restrict the access to this project to a full read-only and switch the queries ...
0
votes
1
answer
458
views
Best Practice - Python Check if a GCP Log Exists
I'm in this situation where I need to verify, with python, if a certain GCP log exists.
I've built a precise filter that, if the service works, return a single log. Else, doesn't return anything.
Here ...
0
votes
1
answer
674
views
On GCP, using the python pubsub client, how to list only a subset of subscriptions based on a filter
On the gcloud cli, when listing the pubsub subscriptions of a project, it is possible to filter results by using the --filter flag. Here is an example:
gcloud --project=my-project pubsub subscriptions ...
1
vote
1
answer
2k
views
Google Cloud SecretManagerServiceClient() is not finding creds with .from_service_account_json() file
Getting this error:
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run ...