If you are using pydatalab, then you should take a look at the Python module called google.datalab.bigquery. This module allows you, amongs other things, to initializes an instance of a Query object with different parameters (e.g.: sql query, context, sources, etc...).
You also have a class for the DatasetName.
Not exactly sure why you need to set the default dataset. What you can do is something like:
my_obj = bq.DatasetName('myProjectId', 'myDatasetId')
and then you can get the datasetId: my_obj.dataset_id
.
For instance:
import google.datalab.bigquery as bq
my_obj = bq.DatasetName('projectid', 'datasetid')
query = bq.Query("SELECT * FROM " + "`" + my_obj.dataset_id + ".table`" + " LIMIT 1000")
output_options = bq.QueryOutput.table(use_cache=False)
result = query.execute(output_options=output_options).result()
result