Skip to content

Commit

Permalink
feat: add matched_token_page_indices field in Document Warehouse AP…
Browse files Browse the repository at this point in the history
…I v1 (#11759)

BEGIN_COMMIT_OVERRIDE
feat: add matched_token_page_indices field in Document Warehouse API v1
END_COMMIT_OVERRIDE
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 568417218

Source-Link:
googleapis/googleapis@d2668fc

Source-Link:
googleapis/googleapis-gen@200db84
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRlbnR3YXJlaG91c2UvLk93bEJvdC55YW1sIiwiaCI6IjIwMGRiODQ2OGMwMzg3N2FjY2FlZTliMTM0ZGZkNTFiNDkyMTgwOTAifQ==

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: ohmayr <omairnaveed@ymail.com>
  • Loading branch information
3 people authored Sep 26, 2023
1 parent a300b07 commit 030a767
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 27 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-contentwarehouse/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system- -- -k <name of test>
$ nox -s system-3.11 -- -k <name of test>


.. note::

System tests are only configured to run under Python.
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.7.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.7.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ class MatchingDocument(proto.Message):
Experimental.
Additional result info if the question-answering
feature is enabled.
matched_token_page_indices (MutableSequence[int]):
Return the 1-based page indices where those
pages have one or more matched tokens.
"""

document: gcc_document.Document = proto.Field(
Expand All @@ -236,6 +239,10 @@ class MatchingDocument(proto.Message):
number=3,
message="QAResult",
)
matched_token_page_indices: MutableSequence[int] = proto.RepeatedField(
proto.INT64,
number=4,
)

@property
def raw_page(self):
Expand Down
23 changes: 1 addition & 22 deletions packages/google-cloud-contentwarehouse/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
UNIT_TEST_EXTRAS = []
UNIT_TEST_EXTRAS_BY_PYTHON = {}

SYSTEM_TEST_PYTHON_VERSIONS = []
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
Expand Down Expand Up @@ -405,24 +405,3 @@ def prerelease_deps(session):
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")

session.run("py.test", "tests/unit")

system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")

# Only run system tests if found.
if os.path.exists(system_test_path):
session.run(
"py.test",
"--verbose",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_path,
*session.posargs,
)
if os.path.exists(system_test_folder_path):
session.run(
"py.test",
"--verbose",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_folder_path,
*session.posargs,
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-contentwarehouse",
"version": "0.7.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 030a767

Please sign in to comment.