Hi @umeshchandra ,
Welcome back to Google Cloud Community.
The dataform_v1beta1.WorkspacesClient.initialize_workspace method can be used to initialize a workspace using the Python client library for Dataform. Here is a sample of code that demonstrates initializing a workspace:
from google.cloud import dataform_v1beta1
from google.auth.credentials import AnonymousCredentials
Create a Dataform client using AnonymousCredentials
client = dataform_v1beta1.DataformClient(credentials=AnonymousCredentials())
Initialize a workspace
response = client.workspaces.initialize_workspace(
parent=“projects/{project_id}”.format(project_id=“your-project-id”),
workspace_id=“your-workspace-id”,
version=“latest”,
)
Replace “your-project-id” and “your-workspace-id” with your actual project ID and workspace ID, respectively, in the aforementioned code.
You can use the dataform_v1beta1.JobsClient.create_job method to run a pipeline using the Python client library for Dataform. Here is a sample of code that illustrates how to run a pipeline:
from google.cloud import dataform_v1beta1
from google.auth.credentials import AnonymousCredentials
Create a Dataform client using AnonymousCredentials
client = dataform_v1beta1.DataformClient(credentials=AnonymousCredentials())
Create a job to execute the pipeline
response = client.jobs.create_job(
parent=“projects/{project_id}/locations/{location}/workspaces/{workspace_id}”.format(
project_id=“your-project-id”,
location=“your-location”,
workspace_id=“your-workspace-id”,
),
job={
“type”: “PIPELINE”,
“request”: {
“pipeline_execution”: {
“pipeline_name”: “your-pipeline-name”,
},
},
},
)
Replace “your-project-id”, “your-location”, “your-workspace-id”, and “your-pipeline-name” with your actual project ID, location, workspace ID, and pipeline name, on the given code.
Here are some documentation that might help you:
https://cloud.google.com/dataflow/docs/quickstarts/create-pipeline-python?_ga=2.218493529.-1392753435.1676655686
https://cloud.google.com/python/docs/reference/lifesciences/latest/google.cloud.lifesciences_v2beta.types.Pipeline?_ga=2.218493529.-1392753435.1676655686
https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataform.V1Beta1/latest/Google.Cloud.Dataform.V1Beta1.Dataform?_ga=2.154680824.-1392753435.1676655686