def execute_query_with_retries()

in python/pipelines/components/bigquery/component.py [0:0]


    def execute_query_with_retries(query):
        """Executes the query with retries."""
        query_job = client.query(query, retry=retry_predicate)

        while not query_job.done():  # Check if the query job is complete
            print("Query running...")
            time.sleep(retry_delay)  # Wait before checking status again
            query_job.reload()  # Reload the job state

        if query_job.errors:
            raise RuntimeError(f"Query errors: {query_job.errors}")

        return query_job.result()  # Return the results