Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

Commit

Permalink
Pass job object instead of job_id to ResultProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Keisuke Nishida committed May 28, 2015
1 parent 1be0300 commit fad01e6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pandas_td/td.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ def execute(self, query, **kwargs):

# issue query
job = self.connection.client.query(self.database, query, **params)

# wait
while not job.finished():
time.sleep(2)
job._update_status()
Expand All @@ -85,13 +83,13 @@ def execute(self, query, **kwargs):
job.status(),
job._debug['cmdout']))

# result as DataFrame
return ResultProxy(self, job.job_id)
# result
return ResultProxy(self, job)

class ResultProxy(object):
def __init__(self, engine, job_id):
def __init__(self, engine, job):
self.engine = engine
self.job = engine.connection.client.job(job_id)
self.job = job
self._iter = None

@property
Expand Down

0 comments on commit fad01e6

Please sign in to comment.