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

Method resolve

python/graphscope/framework/loader.py:167–192  ·  view source on GitHub ↗

Dispatch resolver based on type of source. Args: source: Different data sources Raises: RuntimeError: If the source is a not supported type.

(self, source)

Source from the content-addressed store, hash-verified

165 return self.__str__()
166
167 def resolve(self, source):
168 """Dispatch resolver based on type of source.
169
170 Args:
171 source: Different data sources
172
173 Raises:
174 RuntimeError: If the source is a not supported type.
175 """
176 if isinstance(source, str):
177 self.process_location(source)
178 elif isinstance(source, pathlib.Path):
179 self.process_location(str(source))
180 elif isinstance(source, pd.DataFrame):
181 self.process_pandas(source)
182 elif vineyard is not None and isinstance(
183 source, (vineyard.Object, vineyard.ObjectID, vineyard.ObjectName)
184 ):
185 self.process_vy_object(source)
186 elif isinstance(source, Sequence):
187 # Assume a list of numpy array are passed as COO matrix, with length >= 2.
188 # Formats: [src_id, dst_id, prop_1, ..., prop_n]
189 check_argument(all([isinstance(item, np.ndarray) for item in source]))
190 self.process_numpy(source)
191 else:
192 raise RuntimeError("Not support source", source)
193
194 def process_location(self, source):
195 self.protocol = urlparse(source).scheme

Callers 4

__init__Method · 0.95
precompile.pyFile · 0.45
bootstrapServicesMethod · 0.45
get_local_toctree_forMethod · 0.45

Calls 5

process_locationMethod · 0.95
process_pandasMethod · 0.95
process_vy_objectMethod · 0.95
process_numpyMethod · 0.95
check_argumentFunction · 0.90

Tested by

no test coverage detected