(data_source: DataSource)
| 63 | |
| 64 | @staticmethod |
| 65 | def from_data_source(data_source: DataSource) -> "SavedDatasetStorage": |
| 66 | data_source_type = type(data_source).__name__ |
| 67 | if data_source_type in _DATA_SOURCE_TO_SAVED_DATASET_STORAGE: |
| 68 | cls = get_saved_dataset_storage_class_from_path( |
| 69 | _DATA_SOURCE_TO_SAVED_DATASET_STORAGE[data_source_type] |
| 70 | ) |
| 71 | return cls.from_data_source(data_source) |
| 72 | else: |
| 73 | raise ValueError( |
| 74 | f"This method currently does not support {data_source_type}." |
| 75 | ) |
| 76 | |
| 77 | |
| 78 | class SavedDataset: |