3939logger = logging .getLogger ("graphscope" )
4040
4141class FetchDataloadingJobStatus (object ):
42- def __init__ (self , graph , status : JobStatus ):
42+ def __init__ (self , graph , status : JobStatus , project = PROJECT ):
4343 self ._graph = graph
4444 self ._status = status
45+ self ._project = project
4546 self ._fetching_thread = StoppableThread (target = self ._fetch_impl , args = ())
4647 self ._fetching_thread .daemon = True
4748 self ._fetching_thread .start ()
@@ -52,7 +53,7 @@ def _fetch_impl(self):
5253 s = self ._status .to_dict ()
5354 conn = http .client .HTTPConnection (STUDIO_WRAPPER_ENDPOINT )
5455 params = urllib .parse .urlencode (
55- {"jobId" : s ["id" ], "project" : PROJECT , "baseId" : BASEID }
56+ {"jobId" : s ["id" ], "project" : self . _project , "baseId" : BASEID }
5657 )
5758 while not self ._fetching_thread .stopped ():
5859 try :
@@ -294,13 +295,15 @@ def run(self):
294295 location = data_source ["inputs" ][0 ]
295296 load_from_odps = load_from_odps and location .startswith ("odps://" )
296297
298+ project = PROJECT
297299 if not load_from_odps :
298300 status = self .import_data_from_local_file ()
299301 else :
300302 # load from odps
301303 configini = convert_to_configini (
302304 self ._graph , self ._ds_manager , self ._config
303305 )
306+ project = configini ["project" ]
304307 # conn
305308 conn = http .client .HTTPConnection (STUDIO_WRAPPER_ENDPOINT )
306309 conn .request (
@@ -337,4 +340,4 @@ def run(self):
337340 if isinstance (conn , http .client .HTTPConnection ):
338341 conn .close ()
339342 # register job status
340- self ._job_status [self .jobid ] = FetchDataloadingJobStatus (self ._graph , status )
343+ self ._job_status [self .jobid ] = FetchDataloadingJobStatus (self ._graph , status , project )
0 commit comments