@@ -289,23 +289,6 @@ def __init__(
289
289
self ._version = self ._pick_version (version )
290
290
# Compute the base directory (for download) and dataset/version directory.
291
291
self ._data_dir_root , self ._data_dir = self ._build_data_dir (data_dir )
292
- # If the dataset info is available, use it.
293
- if dataset_info .dataset_info_path (self .data_path ).exists ():
294
- self .info .read_from_directory (self ._data_dir )
295
- else : # Use the code version (do not restore data)
296
- self .info .initialize_from_bucket ()
297
- if self .BLOCKED_VERSIONS is not None :
298
- config_name = self ._builder_config .name if self ._builder_config else None
299
- if is_blocked := self .BLOCKED_VERSIONS .is_blocked (
300
- version = self ._version , config = config_name
301
- ):
302
- default_msg = (
303
- f"Dataset { self .name } is blocked at version { self ._version } and"
304
- f" config { config_name } ."
305
- )
306
- self .info .set_is_blocked (
307
- is_blocked .blocked_msg if is_blocked .blocked_msg else default_msg
308
- )
309
292
310
293
@utils .classproperty
311
294
@classmethod
@@ -510,6 +493,23 @@ def info(self) -> dataset_info.DatasetInfo:
510
493
"DatasetBuilder._info should returns `tfds.core.DatasetInfo`, not "
511
494
f" { type (info )} ."
512
495
)
496
+ # If the dataset info is available, use it.
497
+ if dataset_info .dataset_info_path (self .data_path ).exists ():
498
+ info .read_from_directory (self .data_path )
499
+ else : # Use the code version (do not restore data)
500
+ info .initialize_from_bucket ()
501
+ if self .BLOCKED_VERSIONS is not None :
502
+ config_name = self ._builder_config .name if self ._builder_config else None
503
+ if is_blocked := self .BLOCKED_VERSIONS .is_blocked (
504
+ version = self ._version , config = config_name
505
+ ):
506
+ default_msg = (
507
+ f"Dataset { self .name } is blocked at version { self ._version } and"
508
+ f" config { config_name } ."
509
+ )
510
+ info .set_is_blocked (
511
+ is_blocked .blocked_msg if is_blocked .blocked_msg else default_msg
512
+ )
513
513
return info
514
514
515
515
@utils .classproperty
0 commit comments