MCPcopy Create free account
hub / github.com/alibaba/GraphScope / read_bytes

Method read_bytes

python/graphscope/analytical/udf/utils.py:280–293  ·  view source on GitHub ↗

Read bytes value of the zip file. Parameters ---------- raw: bool If True, return the raw bytes. Otherwise return the BytesIO object.

(self, raw=False)

Source from the content-addressed store, hash-verified

278 self.zip_file.writestr(zipfile.ZipInfo(filepath), content)
279
280 def read_bytes(self, raw=False):
281 """Read bytes value of the zip file.
282
283 Parameters
284 ----------
285 raw: bool
286 If True, return the raw bytes. Otherwise return the BytesIO object.
287 """
288 # close the file first before reading bytes, close repeatedly is OK.
289 self.zip_file.close()
290 if raw:
291 return self.in_memory_buffer.getvalue()
292 else:
293 return self.in_memory_buffer

Callers 4

add_libMethod · 0.95
wrap_initFunction · 0.95
callFunction · 0.45
__init__Method · 0.45

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected