kbl commented on a change in pull request #3043:  AIRFLOW-2107 add 
time_partitioning to run_query on BigQueryBaseCursor
URL: https://github.com/apache/incubator-airflow/pull/3043#discussion_r220225343
 
 

 ##########
 File path: airflow/contrib/hooks/bigquery_hook.py
 ##########
 @@ -1485,3 +1490,17 @@ def var_print(var_name):
         project_id = default_project_id
 
     return project_id, dataset_id, table_id
+
+
+def _cleanse_time_partitioning(destination_dataset_table, 
time_partitioning_in):
+    # if it is a partitioned table ($ is in the table name) add partition load 
option
+    time_partitioning_out = {}
+    if destination_dataset_table and '$' in destination_dataset_table:
+        assert not time_partitioning_in.get('field'), (
 
 Review comment:
   Why this assertion was placed there? When there is a table that is 
partitioned by custom column and I'd like to load results of some query to it 
it fails with one of two reasons:
   
   1. when destination_dataset_table=table$partition is specified and 
time_partitioning is specified it fails on this assertion
   2. when destination_dataset_table=table$partition is specified and 
time_partitioning is missing it fails with "'Incompatible table partitioning 
specification. Expects partitioning specification 
interval(type:day,field:time), but input partitioning specification is 
interval(type:day)'"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to