def create_bq_view_with_analysis_rules()

in analytics-hub/snippets/create_listing_python/main.py [0:0]


def create_bq_view_with_analysis_rules(client: bigquery.Client, project_id: str, dataset_id: str, source_table_id: str, dst_table_id: str):
    """Creates a BigQuery view using the generated DDL statement."""
    ddl_statement = bq_view_prep_ddl(project_id, dataset_id, source_table_id, dst_table_id, "test")

    query_job = client.query(ddl_statement)

    # Wait for the query job to complete and check for errors.
    query_job.result() 
    if query_job.error_result:
        print(query_job.error_result)
        return False

    return True