File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
tensorflow_datasets/core/dataset_builders Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 42
42
from tensorflow_datasets .core import dataset_builder
43
43
from tensorflow_datasets .core import dataset_info
44
44
from tensorflow_datasets .core import download
45
+ from tensorflow_datasets .core import naming
45
46
from tensorflow_datasets .core import split_builder as split_builder_lib
46
47
from tensorflow_datasets .core import splits as splits_lib
47
48
from tensorflow_datasets .core .features import feature as feature_lib
@@ -173,7 +174,9 @@ def __init__(
173
174
if mapping is None :
174
175
mapping = {}
175
176
self .dataset = mlc .Dataset (jsonld , mapping = mapping )
176
- self .name = py_utils .make_valid_name (self .dataset .metadata .name )
177
+ self .name = py_utils .make_valid_name (
178
+ naming .camelcase_to_snakecase (self .dataset .metadata .name )
179
+ )
177
180
self .metadata = self .dataset .metadata
178
181
179
182
# In TFDS, version is a mandatory attribute, while in Croissant it is only a
@@ -189,7 +192,8 @@ def __init__(
189
192
record_set .id for record_set in self .metadata .record_sets
190
193
]
191
194
config_names = [
192
- py_utils .make_valid_name (record_set ) for record_set in record_set_ids
195
+ py_utils .make_valid_name (naming .camelcase_to_snakecase (record_set ))
196
+ for record_set in record_set_ids
193
197
]
194
198
self .BUILDER_CONFIGS : Sequence [dataset_builder .BuilderConfig ] = [ # pylint: disable=invalid-name
195
199
dataset_builder .BuilderConfig (name = config_name )
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ def setUpClass(cls):
194
194
)
195
195
196
196
def test_dataset_info (self ):
197
- assert self .builder .name == "DummyDataset "
197
+ assert self .builder .name == "dummy_dataset "
198
198
assert self .builder .version == "1.2.0"
199
199
assert (
200
200
self .builder ._info ().citation
You can’t perform that action at this time.
0 commit comments