diff --git a/docs/tutorials/bigtable.ipynb b/docs/tutorials/bigtable.ipynb index 49e92d14a..ef33763dc 100644 --- a/docs/tutorials/bigtable.ipynb +++ b/docs/tutorials/bigtable.ipynb @@ -233,7 +233,7 @@ "source": [ "import tensorflow as tf\n", "import numpy as np\n", - "import tensorflow_io.bigtable as bt\n", + "import tensorflow_io as tfio\n", "import random\n", "\n", "random.seed(10)" @@ -268,7 +268,7 @@ "# If using your bigtable instance replace the project_id, instance_id \n", "# and the name of the table with suitable values.\n", "\n", - "client = bt.BigtableClient(project_id=\"test-project\", instance_id=\"test-instance\")\n", + "client = tfio.bigtable.BigtableClient(project_id=\"test-project\", instance_id=\"test-instance\")\n", "train_table = client.get_table(\"t1\")" ] }, @@ -298,7 +298,7 @@ }, "outputs": [], "source": [ - "row_set = bt.row_set.from_rows_or_ranges(bt.row_range.infinite())\n", + "row_set = tfio.bigtable.row_set.from_rows_or_ranges(tfio.bigtable.row_range.infinite())\n", "\n", "train_dataset = train_table.read_rows([\"cf1:c1\"],row_set, output_type=tf.string)\n", "\n", @@ -364,9 +364,9 @@ }, "outputs": [], "source": [ - "row_range_below_300 = bt.row_range.right_open(\"row000\", \"row300\")\n", + "row_range_below_300 = tfio.bigtable.row_range.right_open(\"row000\", \"row300\")\n", "\n", - "my_row_set = bt.row_set.from_rows_or_ranges(row_range_below_300, \"row585\", \"row832\")\n", + "my_row_set = tfio.bigtable.row_set.from_rows_or_ranges(row_range_below_300, \"row585\", \"row832\")\n", "print(my_row_set)" ] }, @@ -390,8 +390,8 @@ }, "outputs": [], "source": [ - "my_truncated_row_set = bt.row_set.intersect(my_row_set,\n", - " bt.row_range.right_open(\"row200\", \"row700\"))\n", + "my_truncated_row_set = tfio.bigtable.row_set.intersect(my_row_set,\n", + " tfio.bigtable.row_range.right_open(\"row200\", \"row700\"))\n", "print(my_truncated_row_set)" ] }, @@ -426,8 +426,8 @@ "\n", "start = datetime(2020, 10, 10, 12, 0, 0)\n", "end = datetime(2100, 10, 10, 13, 0, 0)\n", - "from_datetime = bt.filters.timestamp_range(start, end)\n", - "from_posix_timestamp = bt.filters.timestamp_range(int(start.timestamp()), int(end.timestamp()))\n", + "from_datetime = tfio.bigtable.filters.timestamp_range(start, end)\n", + "from_posix_timestamp = tfio.bigtable.filters.timestamp_range(int(start.timestamp()), int(end.timestamp()))\n", "print(\"from_datetime:\", from_datetime)\n", "\n", "print(\"from_posix_timestamp:\", from_posix_timestamp)" diff --git a/tensorflow_io/python/api/__init__.py b/tensorflow_io/python/api/__init__.py index 599b20902..a057e2667 100644 --- a/tensorflow_io/python/api/__init__.py +++ b/tensorflow_io/python/api/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2018 The TensorFlow Authors. All Rights Reserved. +# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ from tensorflow_io.python.api import audio from tensorflow_io.python.api import version from tensorflow_io.python.api import experimental +from tensorflow_io.python.api import bigtable if os.environ.get("GENERATING_TF_DOCS", ""): # Mark these as public api for /tools/docs/build_docs.py diff --git a/tensorflow_io/bigtable.py b/tensorflow_io/python/api/bigtable.py similarity index 71% rename from tensorflow_io/bigtable.py rename to tensorflow_io/python/api/bigtable.py index 0ba92142f..c43c77c16 100644 --- a/tensorflow_io/bigtable.py +++ b/tensorflow_io/python/api/bigtable.py @@ -12,33 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Cloud Bigtable Client for TensorFlow. +"""tensorflow_io.bigtable""" -This package allows TensorFlow to interface directly with Cloud Bigtable -for high-speed data loading. - -@@BigtableClient -@@BigtableTable -@@RowRange -@@RowSet - - -""" - - -from tensorflow.python.util.all_util import remove_undocumented from tensorflow_io.python.ops.bigtable.bigtable_dataset_ops import BigtableClient from tensorflow_io.python.ops.bigtable.bigtable_dataset_ops import BigtableTable import tensorflow_io.python.ops.bigtable.bigtable_version_filters as filters import tensorflow_io.python.ops.bigtable.bigtable_row_set as row_set import tensorflow_io.python.ops.bigtable.bigtable_row_range as row_range - -_allowed_symbols = [ - "BigtableClient", - "BigtableTable", - "filters", - "row_set", - "row_range", -] - -remove_undocumented(__name__, _allowed_symbols)