(data_frame, save_index=False)
| 738 | |
| 739 | |
| 740 | def _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 | |
| 758 | def _test_DefaultDataParser(): |
no test coverage detected