@@ -553,14 +553,10 @@ def get_reference(
553553 Returns:
554554 a reference to this instantiated builder.
555555 """
556- if self .builder_config :
557- config = self .builder_config .name
558- else :
559- config = None
560556 return naming .DatasetReference (
561557 dataset_name = self .name ,
562558 namespace = namespace ,
563- config = config ,
559+ config = self . builder_config_name ,
564560 version = self .version ,
565561 data_dir = self .data_dir_root ,
566562 )
@@ -576,19 +572,17 @@ def is_prepared(self) -> bool:
576572
577573 def is_blocked (self ) -> utils .IsBlocked :
578574 """Returns whether this builder (version, config) is blocked."""
579- config_name = self .builder_config .name if self .builder_config else None
580575 if blocked_versions := self .blocked_versions :
581576 return blocked_versions .is_blocked (
582- version = self .version , config = config_name
577+ version = self .version , config = self . builder_config_name
583578 )
584579 return utils .IsBlocked (False )
585580
586581 def assert_is_not_blocked (self ) -> None :
587582 """Checks that the dataset is not blocked."""
588- config_name = self .builder_config .name if self .builder_config else None
589583 if blocked_versions := self .blocked_versions :
590584 is_blocked = blocked_versions .is_blocked (
591- version = self .version , config = config_name
585+ version = self .version , config = self . builder_config_name
592586 )
593587 if is_blocked .result :
594588 raise utils .DatasetVariantBlockedError (is_blocked .blocked_msg )
@@ -1382,6 +1376,11 @@ def builder_config(self) -> Optional[Any]:
13821376 """`tfds.core.BuilderConfig` for this builder."""
13831377 return self ._builder_config
13841378
1379+ @property
1380+ def builder_config_name (self ) -> str | None :
1381+ """Name of the `tfds.core.BuilderConfig` for this builder."""
1382+ return self ._builder_config .name if self ._builder_config else None
1383+
13851384 def _create_builder_config (
13861385 self ,
13871386 builder_config : str | BuilderConfig | None ,
0 commit comments