Skip to content

Commit

Permalink
make sql a cached property in BigQueryInsertJobOperator (#33218)
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
  • Loading branch information
mobuchowski committed Aug 9, 2023
1 parent d45781f commit e1af008
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/providers/google/cloud/operators/bigquery.py
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit e1af008

Please sign in to comment.