Skip to content

Commit 82fbcdc

Browse files
authored
fix: unified project field during dataloading progress (#4465)
1 parent f5b2fc0 commit 82fbcdc

File tree

1 file changed

+6
-3
lines changed
  • coordinator/gscoordinator/flex/core/insight

1 file changed

+6
-3
lines changed

coordinator/gscoordinator/flex/core/insight/job.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
logger = logging.getLogger("graphscope")
4040

4141
class 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

Comments
 (0)