MCPcopy
hub / github.com/dmlc/dgl / _get_data_table

Function _get_data_table

tests/python/common/data/test_data.py:740–755  ·  view source on GitHub ↗
(data_frame, save_index=False)

Source from the content-addressed store, hash-verified

738
739
740def _get_data_table(data_frame, save_index=False):
741 from dgl.data.csv_dataset_base import DefaultDataParser
742
743 with tempfile.TemporaryDirectory() as test_dir:
744 csv_path = os.path.join(test_dir, "nodes.csv")
745
746 data_frame.to_csv(csv_path, index=save_index)
747 dp = DefaultDataParser()
748 df = pd.read_csv(csv_path)
749
750 # Warning suppression : "Untitled column found. Ignored...",
751 # which appears when a CSV file is saved with an index:
752 # data_frame.to_csv(csv_path, index=True).
753 with warnings.catch_warnings():
754 warnings.simplefilter("ignore", category=UserWarning)
755 return dp(df)
756
757
758def _test_DefaultDataParser():

Callers 1

_test_DefaultDataParserFunction · 0.85

Calls 3

DefaultDataParserClass · 0.90
read_csvMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected