Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions bigquery/google/cloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,10 @@ def __init__(self, job_id, query, client, job_config=None):
if job_config.use_legacy_sql is None:
job_config.use_legacy_sql = False

self.query = query
_helpers._set_sub_prop(
self._properties, ["configuration", "query", "query"], query
)

self._configuration = job_config
self._query_results = None
self._done_timeout = None
Expand Down Expand Up @@ -2424,6 +2427,17 @@ def priority(self):
"""
return self._configuration.priority

@property
def query(self):
"""str: The query text used in this query job.

See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query.query
"""
return _helpers._get_sub_prop(
self._properties, ["configuration", "query", "query"]
)

@property
def query_parameters(self):
"""See
Expand Down Expand Up @@ -2516,7 +2530,6 @@ def to_api_repr(self):
def _copy_configuration_properties(self, configuration):
"""Helper: assign subclass configuration properties in cleaned."""
self._configuration._properties = copy.deepcopy(configuration)
self.query = _helpers._get_sub_prop(configuration, ["query", "query"])

@classmethod
def from_api_repr(cls, resource, client):
Expand Down