File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,11 @@ def list_imported_builders() -> list[str]:
422
422
builder_name
423
423
for builder_name , builder_cls in _DATASET_REGISTRY .items ()
424
424
if _is_builder_available (builder_cls )
425
- ] + list (_get_existing_dataset_packages (constants .DATASETS_TFDS_SRC_DIR ))
425
+ ]
426
+ if visibility .DatasetType .TFDS_PUBLIC .is_available ():
427
+ all_builders += list (
428
+ _get_existing_dataset_packages (constants .DATASETS_TFDS_SRC_DIR )
429
+ )
426
430
return sorted (all_builders )
427
431
428
432
Original file line number Diff line number Diff line change 13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
16
- """Tests for tensorflow_datasets.core.visibility."""
17
-
18
16
import tensorflow_datasets as tfds
19
17
from tensorflow_datasets .core import visibility
20
18
@@ -28,3 +26,9 @@ def test_visibility():
28
26
# `absl.app` should detect the TFDS script and restrict the visibility
29
27
# to TFDS public by default.
30
28
assert visibility ._current_available == {visibility .DatasetType .TFDS_PUBLIC }
29
+ assert 'mnist' in tfds .list_builders ()
30
+ assert 'abstract_reasoning' in tfds .list_builders ()
31
+ # Remove all visibility and check that the datasets are not available.
32
+ with visibility .set_availables_tmp ([]):
33
+ assert 'mnist' not in tfds .list_builders ()
34
+ assert 'abstract_reasoning' not in tfds .list_builders ()
You can’t perform that action at this time.
0 commit comments