Skip to content

Commit

Permalink
Fix nox generate (#830)
Browse files Browse the repository at this point in the history
* Fix: don't rely on a specific plugin for the test.

Signed-off-by: dblock <[email protected]>

* Ignore ISM.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Sep 27, 2024
1 parent 1b0440a commit 44f712e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test_opensearchpy/test_async/test_plugins_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# GitHub history for details.


import re
import warnings

import pytest
Expand All @@ -24,8 +25,7 @@ async def test_plugins_client(self) -> None:
client = AsyncOpenSearch()
# testing double-init here
client.plugins.__init__(client) # type: ignore # pylint: disable=unnecessary-dunder-call
assert (
str(w[0].message)
== "Cannot load `alerting` directly to AsyncOpenSearch as it already exists. Use "
"`AsyncOpenSearch.plugin.alerting` instead."
assert re.match(
r"Cannot load `\w+` directly to AsyncOpenSearch as it already exists. Use `AsyncOpenSearch.plugin.\w+` instead.",
str(w[0].message),
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.

import re

from opensearchpy.client import OpenSearch

from ...test_cases import TestCase
Expand All @@ -18,8 +20,9 @@ def test_plugins_client(self) -> None:
client = OpenSearch()
# double-init
client.plugins.__init__(client) # type: ignore # pylint: disable=unnecessary-dunder-call
self.assertEqual(
str(w.warnings[0].message),
"Cannot load `alerting` directly to OpenSearch as "
"it already exists. Use `OpenSearch.plugin.alerting` instead.",
self.assertTrue(
re.match(
r"Cannot load `\w+` directly to OpenSearch as it already exists. Use `OpenSearch.plugin.\w+` instead.",
str(w.warnings[0].message),
)
)
4 changes: 4 additions & 0 deletions utils/generate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,10 @@ def read_modules() -> Any:
namespace = "__init__"
name = key

# FIXME: we have a hard-coded index_management that needs to be deprecated in favor of the auto-generated one
if namespace == "ism":
continue

# Group the data in the current group by the "path" key
paths = []
all_paths_have_deprecation = True
Expand Down

0 comments on commit 44f712e

Please sign in to comment.