Skip to content

Commit

Permalink
Move '_convert_timestamp' helper out to module scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Dec 5, 2016
1 parent bacbf24 commit 790733b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions google/cloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,6 @@ def insert_data(self,
rows_info = []
data = {'rows': rows_info}

def _convert_timestamp(value):
if isinstance(value, datetime.datetime):
value = _microseconds_from_datetime(value) * 1e-6
return value

for index, row in enumerate(rows):
row_info = {}

Expand Down Expand Up @@ -1134,3 +1129,10 @@ class _UrlBuilder(object):
def __init__(self):
self.query_params = {}
self._relative_path = ''


def _convert_timestamp(value):
"""Helper for :meth:`Table.insert_data`."""
if isinstance(value, datetime.datetime):
value = _microseconds_from_datetime(value) * 1e-6
return value

0 comments on commit 790733b

Please sign in to comment.