You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BigQuery: ability to set default job / table / dataset configs in client class #5183
The location is considered a global parameter (by the the BigQuery engineering team and the bq command-line tool), and we are tracking the feature to set a default location at #5148.
There are other non-global properties where it would be useful to set a user-configurable default.
For example:
Labels on jobs. It could be useful to set default labels so that folks can track more easily which jobs are getting run by which application.
use_legacy_sql on QueryJobConfig. Right now this defaults to standard SQL syntax, but some people might prefer to use legacy SQL for existing queries.
The destination_encryption_configuration in jobs and the encryption_configuration in tables. Maybe this one actually makes sense as a global parameter, but it's not considered on in the bq command-line tool.
I'm trying to put together a pull request for this, to get us to the behavior we're looking for that was mentioned in #6042 .
However, when trying to run nox, I'm getting errors that I wouldn't expect. For example:
$ nox -f bigquery/nox.py -s "unit(py='3.6')"
nox > Running session unit(py='3.6')
nox > Creating virtualenv using python3 in /home/blaine/experiments/google-cloud-python/.nox/unit-py-3-6
nox > Session unit(py='3.6') raised exception AttributeError("'Session' object has no attribute 'interpreter'",)
Traceback (most recent call last):
File "/home/blaine/.local/lib/python3.6/site-packages/nox/sessions.py", line 297, in execute
self.func(session)
File "/home/blaine/.local/lib/python3.6/site-packages/nox/_parametrize.py", line 92, in call_wrapper
return func(*args, **kwargs)
File "/home/blaine/experiments/google-cloud-python/bigquery/nox.py", line 76, in unit
session.interpreter = 'python{}'.format(py)
AttributeError: 'Session' object has no attribute 'interpreter'
nox > Session unit(py='3.6') failed.
This makes sense, since it seems nox sessions don't have an interpreter attribute (nor a virtualenv_dirname for that matter, which is also set in that method). But it's surprising to me that these errors are popping up for me? Am I running in a context I shouldn't be? Why is the nox file setting non-existent attributes?
@blainehansen I was just able to run the tests using the command line you provided. Note that we would normally run from inside the bigquery directory). Do you have python3.6 on your $PATH when you start?
⬆️ This sounds right. The error I'm getting is a basic python problem (can't assign to a non-existent attribute) so it suggests a misalignment between the code I'm running in the project and the version of nox I have.
I don't know if this is helpful but:
$ nox --version
2018.9.14
Also:
$ which python3.6
/usr/bin/python3.6
$ echo$PATH
...redacted
:/usr/bin:
...redacted
Activity
blainehansen commentedon Sep 22, 2018
I'm trying to put together a pull request for this, to get us to the behavior we're looking for that was mentioned in #6042 .
However, when trying to run
nox, I'm getting errors that I wouldn't expect. For example:This makes sense, since it seems nox sessions don't have an
interpreterattribute (nor avirtualenv_dirnamefor that matter, which is also set in that method). But it's surprising to me that these errors are popping up for me? Am I running in a context I shouldn't be? Why is the nox file setting non-existent attributes?tseaver commentedon Sep 22, 2018
@blainehansen I was just able to run the tests using the command line you provided. Note that we would normally run from inside the
bigquerydirectory). Do you havepython3.6on your$PATHwhen you start?tswast commentedon Sep 24, 2018
I think the Nox error may be due to
nox(new incompatible package) versusnox-automationpackage (what google-cloud-python still uses AFAIK)blainehansen commentedon Sep 24, 2018
⬆️ This sounds right. The error I'm getting is a basic python problem (can't assign to a non-existent attribute) so it suggests a misalignment between the code I'm running in the project and the version of nox I have.
I don't know if this is helpful but:
Also:
blainehansen commentedon Sep 24, 2018
Yep, installing and using
nox-automationfixed it :) 🎊 🎊