Skip to content

Commit

Permalink
Updated dependencies.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Aug 13, 2024
1 parent 581cbba commit b4913a0
Show file tree
Hide file tree
Showing 15 changed files with 994 additions and 790 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Dependencies
- Bump `pytest-asyncio` from <=0.23.7 to <=0.23.8 ([#787](https://github.com/opensearch-project/opensearch-py/pull/787))
- Bump `sphinx` from <7.4 to <7.5 ([#788](https://github.com/opensearch-project/opensearch-py/pull/788))
- Bump `urllib3` from >=1.26.18 to >=1.26.19 ([#793](https://github.com/opensearch-project/opensearch-py/pull/793))
- Bump `requests` from >=2.4.0 to >=2.32.0 ([#793](https://github.com/opensearch-project/opensearch-py/pull/793))
- Bump `certifi` from >=2022.12.07 to >=2024.07.04 ([#793](https://github.com/opensearch-project/opensearch-py/pull/793))

## [2.6.0]
### Added
Expand Down
915 changes: 497 additions & 418 deletions benchmarks/poetry.lock

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# OpenSearch Python Samples

Most samples can be run using OpenSearch installed locally with docker.
Most samples can be run using OpenSearch installed locally with Docker.

## Admin User Password

Add the default `admin` password to the environment.

```
export OPENSEARCH_PASSWORD=myStrongPassword123!
```

## Start the Container

```
docker pull opensearchproject/opensearch:latest
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:latest
docker run -d -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD=$OPENSEARCH_PASSWORD -e "discovery.type=single-node" opensearchproject/opensearch:latest
```

## Prerequisites
## Install Python Prerequisites

Install [poetry](https://python-poetry.org/docs/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
import os
import time

from opensearchpy import OpenSearch
Expand All @@ -27,7 +28,7 @@ def main() -> None:
hosts=["https://localhost:9200"],
use_ssl=True,
verify_certs=False,
http_auth=("admin", "admin"),
http_auth=("admin", os.getenv("OPENSEARCH_PASSWORD", "admin")),
)
client.indices.create(index="movies")
print("'movies' index created!")
Expand Down
4 changes: 3 additions & 1 deletion samples/document_lifecycle/document_lifecycle_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.

import os

from opensearchpy import OpenSearch

# For cleaner output, comment in the two lines below to disable warnings and informational messages
Expand All @@ -26,7 +28,7 @@ def main() -> None:
hosts=["https://localhost:9200"],
use_ssl=True,
verify_certs=False,
http_auth=("admin", "admin"),
http_auth=("admin", os.getenv("OPENSEARCH_PASSWORD", "admin")),
)

# Create an index
Expand Down
7 changes: 6 additions & 1 deletion samples/hello/hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# GitHub history for details.


import os

from opensearchpy import OpenSearch

# connect to OpenSearch
Expand All @@ -23,7 +25,10 @@ def main() -> None:
"""
host = "localhost"
port = 9200
auth = ("admin", "admin") # For testing only. Don't store credentials in code.
auth = (
"admin",
os.getenv("OPENSEARCH_PASSWORD", "admin"),
) # For testing only. Don't store credentials in code.

client = OpenSearch(
hosts=[{"host": host, "port": port}],
Expand Down
6 changes: 5 additions & 1 deletion samples/hello/hello_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


import asyncio
import os

from opensearchpy import AsyncOpenSearch

Expand All @@ -24,7 +25,10 @@ async def main() -> None:
# connect to OpenSearch
host = "localhost"
port = 9200
auth = ("admin", "admin") # For testing only. Don't store credentials in code.
auth = (
"admin",
os.getenv("OPENSEARCH_PASSWORD", "admin"),
) # For testing only. Don't store credentials in code.

client = AsyncOpenSearch(
hosts=[{"host": host, "port": port}],
Expand Down
4 changes: 3 additions & 1 deletion samples/index_template/index_template_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
import os

from opensearchpy import OpenSearch


Expand All @@ -32,7 +34,7 @@ def main() -> None:
hosts=["https://localhost:9200"],
use_ssl=True,
verify_certs=False,
http_auth=("admin", "admin"),
http_auth=("admin", os.getenv("OPENSEARCH_PASSWORD", "admin")),
)

# create an index template
Expand Down
7 changes: 6 additions & 1 deletion samples/json/json_hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# GitHub history for details.


import os

from opensearchpy import OpenSearch


Expand All @@ -21,7 +23,10 @@ def main() -> None:

host = "localhost"
port = 9200
auth = ("admin", "admin") # For testing only. Don't store credentials in code.
auth = (
"admin",
os.getenv("OPENSEARCH_PASSWORD", "admin"),
) # For testing only. Don't store credentials in code.

client = OpenSearch(
hosts=[{"host": host, "port": port}],
Expand Down
6 changes: 5 additions & 1 deletion samples/json/json_hello_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


import asyncio
import os

from opensearchpy import AsyncOpenSearch

Expand All @@ -24,7 +25,10 @@ async def main() -> None:
# connect to OpenSearch
host = "localhost"
port = 9200
auth = ("admin", "admin") # For testing only. Don't store credentials in code.
auth = (
"admin",
os.getenv("OPENSEARCH_PASSWORD", "admin"),
) # For testing only. Don't store credentials in code.

client = AsyncOpenSearch(
hosts=[{"host": host, "port": port}],
Expand Down
3 changes: 2 additions & 1 deletion samples/logging/log_collection_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# GitHub history for details.

import logging
import os
import queue
from datetime import datetime
from logging.handlers import QueueHandler, QueueListener
Expand Down Expand Up @@ -41,7 +42,7 @@ def main() -> None:
use_ssl=True,
verify_certs=False,
ssl_show_warn=False,
http_auth=("admin", "admin"),
http_auth=("admin", os.getenv("OPENSEARCH_PASSWORD", "admin")),
)

# Initialize a logger named "OpenSearchLogs" for OpenSearch
Expand Down
Loading

0 comments on commit b4913a0

Please sign in to comment.