You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by fo...@apache.org on 2018/03/06 09:24:22 UTC
incubator-airflow git commit: [AIRFLOW-2176] Change the way logging
is carried out in BQ Get Data Operator
Repository: incubator-airflow
Updated Branches:
refs/heads/master 587a14b26 -> 6344d1e1b
[AIRFLOW-2176] Change the way logging is carried out in BQ Get Data Operator
- Changed the way logging is implemented in
`BigQueryGetDataOperator`. Changed `logging.info`
to `self.log.info`
Closes #3096 from kaxil/AIRFLOW-2176
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/6344d1e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/6344d1e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/6344d1e1
Branch: refs/heads/master
Commit: 6344d1e1b1a72481060c44f602da57ba86964098
Parents: 587a14b
Author: Kaxil Naik <ka...@gmail.com>
Authored: Tue Mar 6 10:24:17 2018 +0100
Committer: Fokko Driesprong <fo...@godatadriven.com>
Committed: Tue Mar 6 10:24:17 2018 +0100
----------------------------------------------------------------------
airflow/contrib/operators/bigquery_get_data.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6344d1e1/airflow/contrib/operators/bigquery_get_data.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/bigquery_get_data.py b/airflow/contrib/operators/bigquery_get_data.py
index 4c12f01..019bb58 100644
--- a/airflow/contrib/operators/bigquery_get_data.py
+++ b/airflow/contrib/operators/bigquery_get_data.py
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import logging
-
from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
@@ -86,9 +84,9 @@ class BigQueryGetDataOperator(BaseOperator):
self.delegate_to = delegate_to
def execute(self, context):
- logging.info('Fetching Data from:')
- logging.info('Dataset: %s ; Table: %s ; Max Results: %s',
- self.dataset_id, self.table_id, self.max_results)
+ self.log.info('Fetching Data from:')
+ self.log.info('Dataset: %s ; Table: %s ; Max Results: %s',
+ self.dataset_id, self.table_id, self.max_results)
hook = BigQueryHook(bigquery_conn_id=self.bigquery_conn_id,
delegate_to=self.delegate_to)
@@ -100,7 +98,7 @@ class BigQueryGetDataOperator(BaseOperator):
max_results=self.max_results,
selected_fields=self.selected_fields)
- logging.info('Total Extracted rows: %s', response['totalRows'])
+ self.log.info('Total Extracted rows: %s', response['totalRows'])
rows = response['rows']
table_data = []