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

Method process_pandas

python/graphscope/framework/loader.py:213–225  ·  view source on GitHub ↗
(self, source: pd.DataFrame)

Source from the content-addressed store, hash-verified

211 return self.process_pandas(df)
212
213 def process_pandas(self, source: pd.DataFrame):
214 self.protocol = "pandas"
215 col_names = list(source.columns.values)
216 col_types = [utils._from_numpy_dtype(dtype) for dtype in source.dtypes.values]
217
218 table = pa.Table.from_pandas(source, preserve_index=False)
219 sink = pa.BufferOutputStream()
220 with pa.ipc.new_stream(sink, table.schema) as writer:
221 writer.write_table(table)
222 buf = sink.getvalue()
223
224 self.deduced_properties = list(zip(col_names, col_types))
225 self.source = bytes(memoryview(buf))
226
227 def process_vy_object(self, source):
228 self.protocol = "vineyard"

Callers 2

resolveMethod · 0.95
process_numpyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected