This is an automated email from the ASF dual-hosted git repository.
eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new e1af008711 make `sql` a cached property in `BigQueryInsertJobOperator`
(#33218)
e1af008711 is described below
commit e1af008711039f7f53b2a21cad70a08b514cd8f6
Author: Maciej Obuchowski <[email protected]>
AuthorDate: Wed Aug 9 07:50:29 2023 +0200
make `sql` a cached property in `BigQueryInsertJobOperator` (#33218)
Signed-off-by: Maciej Obuchowski <[email protected]>
---
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 d665414153..baedeb3347 100644
--- a/airflow/providers/google/cloud/operators/bigquery.py
+++ b/airflow/providers/google/cloud/operators/bigquery.py
@@ -21,6 +21,7 @@ from __future__ import annotations
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 @@ class BigQueryInsertJobOperator(GoogleCloudBaseOperator,
_BigQueryOpenLineageMix
self.deferrable = deferrable
self.poll_interval = poll_interval
- @property
+ @cached_property
def sql(self) -> str | None:
try:
return self.configuration["query"]["query"]