Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
22186d1
started addding udf resources
dwmclary Jul 22, 2016
bdeac5c
added UDFResources to query
dwmclary Jul 22, 2016
5ad14a2
lint and systemtests pass
dwmclary Jul 22, 2016
dafe007
all tests pass
dwmclary Jul 22, 2016
e2a0805
final lint before pr
dwmclary Jul 22, 2016
c4ee959
updated lint warnings
dwmclary Jul 22, 2016
e500987
fixed last linter warning
dwmclary Jul 22, 2016
4a4941c
First pass at Python doc generator...(originally JJ's commit)
daspecster Feb 11, 2016
c2ad035
Initial update to generate json docs
daspecster May 4, 2016
bc584bf
Update site and fix typos.
daspecster Jul 20, 2016
11e897f
Add RST snippet captions.
daspecster Jul 20, 2016
fbd411b
Remove old gh-pages doc build script.
daspecster Jul 22, 2016
a6b2751
Switch to using tox for calling json docs update script.
daspecster Jul 22, 2016
35678f6
Add Sphinx as a dependency for linting.
daspecster Jul 22, 2016
6ee3826
Exclude verify_included_modules.py from lint.
daspecster Jul 23, 2016
b9f8a2f
Add Error Reporting Client
Jun 30, 2016
6aa1c57
Update gcloud references.
daspecster Jul 26, 2016
897f8c0
response to code review, better tests, no backslashes
dwmclary Jul 26, 2016
1b29095
started addding udf resources
dwmclary Jul 22, 2016
79b38e5
coverage fixed
dwmclary Jul 26, 2016
e239baa
fixed linter error, again
dwmclary Jul 26, 2016
95ad07a
re-fixed broken tests
dwmclary Jul 26, 2016
caed23a
Merge branch 'master' of https://github.com/GoogleCloudPlatform/gclou…
dwmclary Jul 26, 2016
6fc3322
fixed author address
dwmclary Jul 27, 2016
a105efc
Merge branch 'master' into fix_author_address
dwmclary Jul 27, 2016
d9a3b2c
fixed classname in docstring
dwmclary Jul 27, 2016
9725f3b
fixed tox.ini to include ordereddict ro dep for py26
dwmclary Jul 27, 2016
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
Prev Previous commit
Next Next commit
started addding udf resources
  • Loading branch information
dwmclary committed Jul 26, 2016
commit 1b290959537b38b6c7d2cd6ff778d789336eb561
25 changes: 23 additions & 2 deletions gcloud/bigquery/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from gcloud.bigquery.job import _build_udf_resources
from gcloud.bigquery.table import _parse_schema_resource


class _SyncQueryConfiguration(object):
"""User-settable configuration options for synchronous query jobs.

Expand All @@ -37,7 +36,26 @@ class _SyncQueryConfiguration(object):
_preserve_nulls = None
_use_query_cache = None
_use_legacy_sql = None


class userDefinedFunctionResource(object):
"""Describe a single user-defined function (UDF) resource.
See
https://cloud.google.com/bigquery/user-defined-functions#api

:type udfType: str
:param udfType: the type of the resource (one of 'inlineCode' or 'resourceUri')

:type value: str
:param value: the inline code or resource URI
"""
def __init__(self, udfType, value):
self.udfType = udfType
self.value = value

def __eq__(self, other):
return(
self.udfType == other.udfType and
self.value == other.value)

class QueryResults(object):
"""Synchronous job: query tables.
Expand Down Expand Up @@ -277,6 +295,8 @@ def udf_resources(self, value):
https://cloud.google.com/bigquery/docs/\
reference/v2/jobs/query#useLegacySql
"""



def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``
Expand Down Expand Up @@ -320,6 +340,7 @@ def _build_resource(self):

return resource


def run(self, client=None):
"""API call: run the query via a POST request

Expand Down