Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nox generate #830

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading