From e1af008711039f7f53b2a21cad70a08b514cd8f6 Mon Sep 17 00:00:00 2001 From: Maciej Obuchowski Date: Wed, 9 Aug 2023 07:50:29 +0200 Subject: [PATCH] make `sql` a cached property in `BigQueryInsertJobOperator` (#33218) Signed-off-by: Maciej Obuchowski --- airflow/providers/google/cloud/operators/bigquery.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airflow/providers/google/cloud/operators/bigquery.py b/airflow/providers/google/cloud/operators/bigquery.py index d6654141532a..baedeb33478f 100644 --- a/airflow/providers/google/cloud/operators/bigquery.py +++ b/airflow/providers/google/cloud/operators/bigquery.py @@ -21,6 +21,7 @@ import enum import json import warnings +from functools import cached_property from typing import TYPE_CHECKING, Any, Iterable, Sequence, SupportsAbs import attr @@ -2737,7 +2738,7 @@ def __init__( self.deferrable = deferrable self.poll_interval = poll_interval - @property + @cached_property def sql(self) -> str | None: try: return self.configuration["query"]["query"]