Skip to content

Commit

Permalink
Fix placeholder block style
Browse files Browse the repository at this point in the history
  • Loading branch information
seanpwlms committed Feb 11, 2025
1 parent 631b2b3 commit 15b1d8b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/integrations/prefect-gcp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ service_account_info = {

GcpCredentials(
service_account_info=service_account_info
).save("BLOCK-NAME-PLACEHOLDER")
).save("CREDENTIALS-BLOCK-NAME-PLACEHOLDER")
```
This credential block can be used to create other `prefect_gcp` blocks.

Expand All @@ -137,29 +137,29 @@ Be sure to [install](#install-extras) `prefect-gcp` with the BigQuery extra.
```python
from prefect_gcp.bigquery import GcpCredentials, BigQueryWarehouse

gcp_credentials = GcpCredentials.load("BLOCK-NAME-PLACEHOLDER")
gcp_credentials = GcpCredentials.load("CREDENTIALS-BLOCK-NAME-PLACEHOLDER")

bigquery_block = BigQueryWarehouse(
gcp_credentials = gcp_credentials,
fetch_size = 1 # Optional: specify a default number of rows to fetch when calling fetch_many
)
bigquery_block.save("my-bigquery-block")
bigquery_block.save("BIGQUERY-BLOCK-NAME-PLACEHOLDER")
```

### Secret Manager
Manage secrets in Google Cloud Platform's Secret Manager.

```python
from prefect_gcp import GcpCredentials, GcpSecret
gcp_credentials = GcpCredentials.load("BLOCK-NAME-PLACEHOLDER")
gcp_credentials = GcpCredentials.load("CREDENTIALS-BLOCK-NAME-PLACEHOLDER")

gcp_secret = GcpSecret(
secret_name = "your-secret-name",
secret_version = "latest",
gcp_credentials = gcp_credentials
)

gcp_secret.save("YOUR-GCP-SECRET-BLOCK-NAME")
gcp_secret.save("SECRET-BLOCK-NAME-PLACEHOLDER")
```

### Cloud Storage
Expand All @@ -168,10 +168,10 @@ Create a block to interact with a GCS bucket.
from prefect_gcp import GcpCredentials, GcsBucket

gcs_bucket = GcsBucket(
bucket="your-bucket-name",
gcp_credentials=GcpCredentials.load("my-gcp-credentials")
bucket="BUCKET-NAME-PLACEHOLDER",
gcp_credentials=GcpCredentials.load("BIGQUERY-BLOCK-NAME-PLACEHOLDER")
)
gcs_bucket.save("my-gcs-bucket-block")
gcs_bucket.save("GCS-BLOCK-NAME-PLACEHOLDER")

```

Expand All @@ -197,7 +197,7 @@ from prefect_gcp.bigquery import GcpCredentials, BigQueryWarehouse
@flow
def bigquery_flow():
all_rows = []
gcp_credentials = GcpCredentials.load("BLOCK-NAME-PLACEHOLDER")
gcp_credentials = GcpCredentials.load("CREDENTIALS-BLOCK-NAME-PLACEHOLDER")

client = gcp_credentials.get_bigquery_client()
client.create_dataset("test_example", exists_ok=True)
Expand Down Expand Up @@ -246,7 +246,7 @@ def cloud_storage_flow():
file_path = Path("test-example.txt")
file_path.write_text("Hello, Prefect!")

gcp_credentials = GcpCredentials.load("BLOCK-NAME-PLACEHOLDER")
gcp_credentials = GcpCredentials.load("CREDENTIALS-BLOCK-NAME-PLACEHOLDER")
gcs_bucket = GcsBucket(
bucket="BUCKET-NAME-PLACEHOLDER",
gcp_credentials=gcp_credentials
Expand Down Expand Up @@ -284,7 +284,7 @@ from prefect_gcp import GcpCredentials, GcpSecret

@flow
def secret_manager_flow():
gcp_credentials = GcpCredentials.load("BLOCK-NAME-PLACEHOLDER")
gcp_credentials = GcpCredentials.load("CREDENTIALS-BLOCK-NAME-PLACEHOLDER")
gcp_secret = GcpSecret(secret_name="test-example", gcp_credentials=gcp_credentials)
gcp_secret.write_secret(secret_data=b"Hello, Prefect!")
secret_data = gcp_secret.read_secret()
Expand Down

0 comments on commit 15b1d8b

Please # to comment.