[
https://issues.apache.org/jira/browse/AIRFLOW-4897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16878636#comment-16878636
]
Benjamin edited comment on AIRFLOW-4897 at 7/4/19 1:12 PM:
-----------------------------------------------------------
I understood the issue, it writes that datasetReference is settable in the next
method
{noformat}
def create_empty_dataset(self, dataset_id="", project_id="",
dataset_reference=None){noformat}
However is not a datasetReference waited but a dataset object.
It's really different, it will be better if parameter dataset_reference become
dataset or dataset_object.
This is a datasetReference :
{code:java}
{
"datasetId": string,
"projectId": string
}{code}
This a dataset :
{noformat}
{
"kind": string,
"etag": string,
"id": string,
"selfLink": string,
"datasetReference": {
object (DatasetReference)
},
"friendlyName": string,
"description": string,
"defaultTableExpirationMs": string,
"defaultPartitionExpirationMs": string,
"labels": {
string: string,
...
},
"access": [
{
"role": string,
"userByEmail": string,
"groupByEmail": string,
"domain": string,
"specialGroup": string,
"iamMember": string,
"view": {
object (TableReference)
}
}
],
"creationTime": string,
"lastModifiedTime": string,
"location": string,
"defaultEncryptionConfiguration": {
object (EncryptionConfiguration)
}
}{noformat}
was (Author: benjamin.grenier):
I understood the issue, it writes that datasetReference is settable in the next
method
{noformat}
def create_empty_dataset(self, dataset_id="", project_id="",
dataset_reference=None){noformat}
{"kind": string,"etag": string,"id": string,"selfLink":
string,"datasetReference": {object
({{[DatasetReference|https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#DatasetReference]}})},"friendlyName":
string,"description": string,"defaultTableExpirationMs":
string,"defaultPartitionExpirationMs": string,"labels": {string:
string,...},"access": [{"role": string,"userByEmail": string,"groupByEmail":
string,"domain": string,"specialGroup": string,"iamMember": string,"view":
{object
({{[TableReference|https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableReference]}})}}],"creationTime":
string,"lastModifiedTime": string,"location":
string,"defaultEncryptionConfiguration": {object
({{[EncryptionConfiguration|https://cloud.google.com/bigquery/docs/reference/rest/v2/EncryptionConfiguration]}})}}
> Location not used to create empty dataset by bigquery_hook cursor
> -----------------------------------------------------------------
>
> Key: AIRFLOW-4897
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4897
> Project: Apache Airflow
> Issue Type: Bug
> Components: hooks
> Affects Versions: 1.10.2, 1.10.3
> Environment: composer-1.7.1-airflow-1.10.2
> Python 3
> Reporter: Benjamin
> Priority: Major
>
> {code:java}
> bq_cursor = BigQueryHook(use_legacy_sql=False,
> bigquery_conn_id='google_cloud_default',
> location=EU").get_conn().cursor()
> print(f'Location Cursor : {bq_cursor.location}') // EU is printed
> bq_cursor.create_empty_dataset(dataset_id, project_id){code}
> 'EU' is printed but my empty dataset has been created in location : 'US'.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)