add external_udf_uris support to query()#120
Conversation
|
lgtm, just one thing regarding the kwarg. Thanks! |
bigquery/client.py
Outdated
| ).execute() | ||
|
|
||
| def query(self, query, max_results=None, timeout=0, dry_run=False, use_legacy_sql=None): | ||
| def query(self, query, max_results=None, timeout=0, dry_run=False, use_legacy_sql=None, external_udf_uris=[]): |
There was a problem hiding this comment.
We shouldn't use lists as a default value for kwargs (see http://reinout.vanrees.org/weblog/2012/04/18/default-parameters.html). This should default to None and check if it's None and assign it to an empty list.
There was a problem hiding this comment.
So I've fixed the existing write_to_table's default arg as well, in a force update.
test coverage. Change write_to_table code to use the same list comprehension to construct userDefinedFunctionResources.
|
Are you up to making a quick 1.9.1 release to PyPI with this change? I'm using BigQuery-Python in my production code, and would like to avoid sourcing this package from my own git repo. |
|
@robin900 I will try to get a release made later today. |
|
@tylertreat So the bad news is that I see two possible solutions:
What are your thoughts? An additional need: external UDFs can be inlined via |
...with docstring and test coverage. Change write_to_table code to use the same
list comprehension to construct userDefinedFunctionResources.