From 911aa373e7892cc04d7b5e5658167c8fec10ac04 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:02:10 +0200 Subject: [PATCH] Cherry pick for v5.0.2 (#3159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump actions/checkout from 3 to 4 (#2969) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rojopolis/spellcheck-github-actions from 0.33.1 to 0.34.0 (#2970) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix type hint (#2963) Co-authored-by: d184230 * Don't perform blocking connect inside the BlockingConnectionQueue Condition variable. (#2997) * Creating CODEOWNERS for the examples (#2993) * Close various objects created during asyncio tests (#3005) * Close various objects created during asyncio tests * Fix resource leake in test_cwe_404.py Need to wait for individual handler tasks when shutting down server. * Linking to Redis resources (#3006) * Add GEOSHAPE field type for index creation of RediSearch (#2957) * first pass of geoshape index type * first attempt at test, but demonstrates the initial commit is broken * fix new field + fix tests * work on linter * more linter * try to mark test with correct fixture * fix linter * Better deal with "lost" connections for async Redis (#2999) * Allow tracking/reporting and closing of "lost" connections. ConnectionPool keeps a WeakSet of in_use connections, allowing lost ones to be collected. Collection produces a warning and closes the underlying transport. * Add tests for the __del__ handlers of async Redis and Connection objects * capture expected warnings in the test * lint * Update client.py sleep_time typing for run_in_thread function (#2977) Changed from `sleep_time: int = 0` to `sleep_time: float = 0.0` To avoid Pylance complaining: `Argument of type "float" cannot be assigned to parameter "sleep_time" of type "int" in function "run_in_thread" "float" is incompatible with "int"` * Fix BlockingConnectionPool.from_url parsing of timeout in query args #2983 (#2984) Co-authored-by: Romain Fliedel * Fix parsing resp3 dicts (#2982) * Update ocsp.py (#3022) * Bump rojopolis/spellcheck-github-actions from 0.34.0 to 0.35.0 (#3060) Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.34.0 to 0.35.0. - [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases) - [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md) - [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.34.0...0.35.0) --- updated-dependencies: - dependency-name: rojopolis/spellcheck-github-actions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Use `disable_decoding` in async `read_response`. (#3042) * Add "sum" to DUPLICATE_POLICY documentation of TS.CREATE, TS.ADD and TS.ALTER (#3027) * Update advanced_features.rst (#3019) * Fix typos. (#3016) * Fix parsing of `FT.PROFILE` result (#3063) * Fix parsing of ft.profile result * test * Make the connection callback methods public again, add documentation (#2980) * Fix reported version of deprecations in asyncio.client (#2968) * Allow the parsing of the asking command to forward original options (#3012) Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * Fix Specifying Target Nodes broken hyperlink (#3072) The typo cause hyperlinks to fail. * Fix return types in json commands (#3071) * Fix return types in JSONCommands class * Update CHANGES * fix acl_genpass with bits (#3062) * Bump github/codeql-action from 2 to 3 (#3096) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/upload-artifact from 3 to 4 (#3097) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/setup-python from 4 to 5 (#3095) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Always sending codecov (#3101) * filter commits for main branch (#3036) * fix(docs): organize cluster mode part of lua scripting (#3073) * Fix typing for `HashCommand.hdel` (#3029) Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * Adding lock_name to LockError (#3023) * Adding lock_name to LockError * Adding lock_name to LockError --------- Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * Fix objlen type hint (#2966) * Fix objlen type hint * Update redis/commands/json/commands.py Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * linters --------- Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * Fix type hint of arbitrary argument lists (#2908) * Fix: hset unexpectedly mutates the list passed to items (#3103) * Fix possible pipeline connections leak (#3104) * Update cluster.py When Executing "n.write()" may generate some unknown errors(e.g. DataError), which could result in the connection not being released. * Update cluster.py * Update cluster.py release connection move to "try...finally" * Update cluster.py fix the linters * fix problems of code review * Add modules support to async RedisCluster (#3115) * Fix grammer in BlockingConnectionPool class documentation (#3120) Co-authored-by: ahmedabdou14 * release already acquired connections on ClusterPipeline, when get_connection raises an exception (#3133) Signed-off-by: zach.lee * Bump actions/stale from 3 to 9 (#3132) Bumps [actions/stale](https://github.com/actions/stale) from 3 to 9. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v3...v9) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump codecov/codecov-action from 3 to 4 (#3131) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Allow to control the minimum SSL version (#3127) * Allow to control the minimum SSL version It's useful for applications that has strict security requirements. * Add tests for minimum SSL version The commit updates test_tcp_ssl_connect for both sync and async connections. Now it sets the minimum SSL version. The test is ran with both TLSv1.2 and TLSv1.3 (if supported). A new test case is test_tcp_ssl_version_mismatch. The test added for both sync and async connections. It uses TLS 1.3 on the client side, and TLS 1.2 on the server side. It expects a connection error. The test is skipped if TLS 1.3 is not supported. * Add example of using a minimum TLS version * docs: Add timeout parameter for get_message example (#3129) The `get_message()` method in asyncio PubSub has a `timeout` argument that defaults to 0.0, causing it to immediately return. This can cause high CPU usage with the given code example and should not be recommended. By setting `timeout=None`, it works with much more efficient resource usage. * Revert stale isuue version update (#3142) * Update connection.py (#3149) Exception ignored in: Traceback .... TypeError: 'NoneType' object cannot be interpreted as an integer. This happens when closing the connection within a spawned Process (multiprocess). * Fix retry logic for pubsub and pipeline (#3134) * Fix retry logic for pubsub and pipeline Extend the fix from bea72995fd39b01e2f0a1682b16b6c7690933f36 to apply to pipeline and pubsub as well. Fixes #2973 * fix isort --------- Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * Update install_requires (#3109) --------- Signed-off-by: dependabot[bot] Signed-off-by: zach.lee Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Artem Diubkov Co-authored-by: d184230 Co-authored-by: Kristján Valur Jónsson Co-authored-by: Chayim Co-authored-by: Shaya Potter Co-authored-by: Bosheng (Daniel) Zhang <740807262@qq.com> Co-authored-by: Romain Co-authored-by: Romain Fliedel Co-authored-by: Aniket Patil <128228805+AniketP04@users.noreply.github.com> Co-authored-by: Stanisław Denkowski Co-authored-by: Pedram Parsian Co-authored-by: BackflipPenguin <63213817+BackflipPenguin@users.noreply.github.com> Co-authored-by: AYMEN Mohammed <53928879+AYMENJD@users.noreply.github.com> Co-authored-by: Zachary Ware Co-authored-by: Tyler Bream (Event pipeline) <97038416+tbbream@users.noreply.github.com> Co-authored-by: Binbin Co-authored-by: Pármenas Haniel <42049025+parmenashp@users.noreply.github.com> Co-authored-by: Wei-Hsiang (Matt) Wang Co-authored-by: Dmitry Kulazhenko Co-authored-by: Dan Lousqui Co-authored-by: trkwyk <50520795+trkwyk@users.noreply.github.com> Co-authored-by: SwordHeart <37992593+zxjlm@users.noreply.github.com> Co-authored-by: Jason <31104990+ING-XIAOJIAN@users.noreply.github.com> Co-authored-by: Ahmed Ashraf <104530599+ahmedabdou14@users.noreply.github.com> Co-authored-by: ahmedabdou14 Co-authored-by: Dongkeun Lee <3315213+zakaf@users.noreply.github.com> Co-authored-by: poiuj <1099644+poiuj@users.noreply.github.com> Co-authored-by: Qiangning Hong Co-authored-by: wKollendorf <83725977+wKollendorf@users.noreply.github.com> Co-authored-by: Will Miller --- .github/CODEOWNERS | 1 + .github/release-drafter-config.yml | 11 ++- .github/workflows/codeql-analysis.yml | 8 +- .github/workflows/docs.yaml | 6 +- .github/workflows/integration.yaml | 27 +++--- .github/workflows/pypi-publish.yaml | 4 +- .github/workflows/spellcheck.yml | 4 +- CHANGES | 6 ++ README.md | 14 +++ docs/advanced_features.rst | 2 +- docs/clustering.rst | 2 +- docs/conf.py | 2 +- docs/examples/asyncio_examples.ipynb | 4 +- docs/examples/pipeline_examples.ipynb | 2 +- docs/examples/ssl_connection_examples.ipynb | 36 ++++++++ docs/lua_scripting.rst | 33 ++++--- redis/_parsers/helpers.py | 2 +- redis/_parsers/hiredis.py | 10 ++- redis/_parsers/resp3.py | 19 +++-- redis/asyncio/client.py | 56 +++++++----- redis/asyncio/cluster.py | 3 + redis/asyncio/connection.py | 85 +++++++++++++++---- redis/client.py | 60 ++++++++----- redis/cluster.py | 60 +++++++------ redis/commands/cluster.py | 9 +- redis/commands/core.py | 23 ++--- redis/commands/helpers.py | 5 ++ redis/commands/json/commands.py | 10 ++- redis/commands/search/field.py | 16 ++++ redis/commands/timeseries/commands.py | 9 ++ redis/connection.py | 24 +++++- redis/exceptions.py | 5 +- redis/lock.py | 33 +++++-- redis/ocsp.py | 6 +- setup.py | 2 +- tests/test_asyncio/test_bloom.py | 26 +----- tests/test_asyncio/test_commands.py | 2 + tests/test_asyncio/test_connect.py | 56 +++++++++++- tests/test_asyncio/test_connection.py | 56 +++++++++++- tests/test_asyncio/test_connection_pool.py | 25 ++++++ tests/test_asyncio/test_cwe_404.py | 17 ++-- tests/test_asyncio/test_graph.py | 20 ----- tests/test_asyncio/test_json.py | 43 +--------- tests/test_asyncio/test_retry.py | 3 + tests/test_asyncio/test_search.py | 2 +- tests/test_asyncio/test_sentinel.py | 22 ++--- .../test_sentinel_managed_connection.py | 1 + tests/test_asyncio/test_timeseries.py | 25 +----- tests/test_cluster.py | 26 ++++++ tests/test_commands.py | 3 +- tests/test_connect.py | 56 ++++++++++-- tests/test_connection_pool.py | 25 ++++++ tests/test_graph.py | 2 +- tests/test_graph_utils/test_edge.py | 2 +- tests/test_graph_utils/test_node.py | 2 +- tests/test_helpers.py | 2 + tests/test_lock.py | 7 ++ tests/test_search.py | 22 ++++- 58 files changed, 723 insertions(+), 321 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..1af2323fe9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +doctests/* @dmaier-redislabs diff --git a/.github/release-drafter-config.yml b/.github/release-drafter-config.yml index 9ccb28aca4..4607da071c 100644 --- a/.github/release-drafter-config.yml +++ b/.github/release-drafter-config.yml @@ -1,5 +1,7 @@ name-template: '$NEXT_MINOR_VERSION' tag-template: 'v$NEXT_MINOR_VERSION' +filter-by-commitish: true +commitish: master autolabeler: - label: 'maintenance' files: @@ -15,7 +17,7 @@ autolabeler: branch: - '/feature-.+' categories: - - title: 'Breaking Changes' + - title: '🔥 Breaking Changes' labels: - 'breakingchange' - title: '🧪 Experimental Features' @@ -32,7 +34,12 @@ categories: - 'bug' - 'BUG' - title: '🧰 Maintenance' - label: 'maintenance' + labels: + - 'maintenance' + - 'dependencies' + - 'documentation' + - 'docs' + - 'testing' change-template: '- $TITLE (#$NUMBER)' exclude-labels: - 'skip-changelog' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e82e7e1530..4670c55b0f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -36,11 +36,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -51,7 +51,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -65,4 +65,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 61ec76e9f8..c5c74aa4d3 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -25,8 +25,8 @@ jobs: name: Build docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.9 cache: 'pip' @@ -40,7 +40,7 @@ jobs: invoke build-docs - name: upload docs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: redis-py-docs path: | diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 7e0fea2e41..584999d8e7 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -29,7 +29,7 @@ jobs: name: Dependency audit runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: pypa/gh-action-pip-audit@v1.0.8 with: inputs: requirements.txt dev_requirements.txt @@ -40,8 +40,8 @@ jobs: name: Code linters runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.9 cache: 'pip' @@ -64,8 +64,8 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' @@ -81,15 +81,14 @@ jobs: sleep 10 # time to settle invoke ${{matrix.test-type}}-tests - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: success() || failure() with: name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}} path: '${{matrix.test-type}}*results.xml' - name: Upload codecov coverage - uses: codecov/codecov-action@v3 - if: ${{matrix.python-version == '3.11'}} + uses: codecov/codecov-action@v4 with: fail_ci_if_error: false @@ -119,8 +118,8 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true name: RESP3 [${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' @@ -146,8 +145,8 @@ jobs: matrix: extension: ['tar.gz', 'whl'] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.9 - name: Run installed unit tests @@ -162,8 +161,8 @@ jobs: matrix: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9'] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index 50332c1995..30720d7b8a 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -12,9 +12,9 @@ jobs: build_and_package: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.9 - name: Install dev tools diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index e152841553..a48781aa84 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -6,9 +6,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check Spelling - uses: rojopolis/spellcheck-github-actions@0.33.1 + uses: rojopolis/spellcheck-github-actions@0.35.0 with: config_path: .github/spellcheck-settings.yml task_name: Markdown diff --git a/CHANGES b/CHANGES index 8cfc47db18..f0e90fc16e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ + * Allow to control the minimum SSL version + * Add an optional lock_name attribute to LockError. + * Fix return types for `get`, `set_path` and `strappend` in JSONCommands + * Connection.register_connect_callback() is made public. + * Fix async `read_response` to use `disable_decoding`. * Add 'aclose()' methods to async classes, deprecate async close(). * Fix #2831, add auto_close_connection_pool=True arg to asyncio.Redis.from_url() * Fix incorrect redis.asyncio.Cluster type hint for `retry_on_error` @@ -55,6 +60,7 @@ * Fix for Unhandled exception related to self.host with unix socket (#2496) * Improve error output for master discovery * Make `ClusterCommandsProtocol` an actual Protocol + * Add `sum` to DUPLICATE_POLICY documentation of `TS.CREATE`, `TS.ADD` and `TS.ALTER` * 4.1.3 (Feb 8, 2022) * Fix flushdb and flushall (#1926) diff --git a/README.md b/README.md index 4bd71b4060..2097e87bba 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,20 @@ The Python interface to the Redis key-value store. --------------------------------------------- +## How do I Redis? + +[Learn for free at Redis University](https://university.redis.com/) + +[Build faster with the Redis Launchpad](https://launchpad.redis.com/) + +[Try the Redis Cloud](https://redis.com/try-free/) + +[Dive in developer tutorials](https://developer.redis.com/) + +[Join the Redis community](https://redis.com/community/) + +[Work at Redis](https://redis.com/company/careers/jobs/) + ## Installation Start a redis via docker: diff --git a/docs/advanced_features.rst b/docs/advanced_features.rst index fd29d2f684..de645bd764 100644 --- a/docs/advanced_features.rst +++ b/docs/advanced_features.rst @@ -346,7 +346,7 @@ running. The third option runs an event loop in a separate thread. pubsub.run_in_thread() creates a new thread and starts the event loop. -The thread object is returned to the caller of [un_in_thread(). The +The thread object is returned to the caller of run_in_thread(). The caller can use the thread.stop() method to shut down the event loop and thread. Behind the scenes, this is simply a wrapper around get_message() that runs in a separate thread, essentially creating a tiny non-blocking diff --git a/docs/clustering.rst b/docs/clustering.rst index 9b4dee1c9f..f8320e4e59 100644 --- a/docs/clustering.rst +++ b/docs/clustering.rst @@ -92,7 +92,7 @@ The ‘target_nodes’ parameter is explained in the following section, >>> # target-node: default-node >>> rc.ping() -Specfiying Target Nodes +Specifying Target Nodes ----------------------- As mentioned above, all non key-based RedisCluster commands accept the diff --git a/docs/conf.py b/docs/conf.py index 8849752404..a201da2fc0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -86,7 +86,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ["_build", "**.ipynb_checkponts"] +exclude_patterns = ["_build", "**.ipynb_checkpoints"] # The reST default role (used for this markup: `text`) to use for all # documents. diff --git a/docs/examples/asyncio_examples.ipynb b/docs/examples/asyncio_examples.ipynb index 5eab4db1f7..5029e907da 100644 --- a/docs/examples/asyncio_examples.ipynb +++ b/docs/examples/asyncio_examples.ipynb @@ -201,7 +201,7 @@ "\n", "async def reader(channel: redis.client.PubSub):\n", " while True:\n", - " message = await channel.get_message(ignore_subscribe_messages=True)\n", + " message = await channel.get_message(ignore_subscribe_messages=True, timeout=None)\n", " if message is not None:\n", " print(f\"(Reader) Message Received: {message}\")\n", " if message[\"data\"].decode() == STOPWORD:\n", @@ -264,7 +264,7 @@ "\n", "async def reader(channel: redis.client.PubSub):\n", " while True:\n", - " message = await channel.get_message(ignore_subscribe_messages=True)\n", + " message = await channel.get_message(ignore_subscribe_messages=True, timeout=None)\n", " if message is not None:\n", " print(f\"(Reader) Message Received: {message}\")\n", " if message[\"data\"].decode() == STOPWORD:\n", diff --git a/docs/examples/pipeline_examples.ipynb b/docs/examples/pipeline_examples.ipynb index 4e20375bfa..36ce31d708 100644 --- a/docs/examples/pipeline_examples.ipynb +++ b/docs/examples/pipeline_examples.ipynb @@ -123,7 +123,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The responses of the three commands are stored in a list. In the above example, the two first boolean indicates that the `set` commands were successfull and the last element of the list is the result of the `get(\"a\")` comand." + "The responses of the three commands are stored in a list. In the above example, the two first boolean indicates that the `set` commands were successful and the last element of the list is the result of the `get(\"a\")` comand." ] }, { diff --git a/docs/examples/ssl_connection_examples.ipynb b/docs/examples/ssl_connection_examples.ipynb index ab3b4415ae..a3d015619f 100644 --- a/docs/examples/ssl_connection_examples.ipynb +++ b/docs/examples/ssl_connection_examples.ipynb @@ -76,6 +76,42 @@ "ssl_connection.ping()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Connecting to a Redis instance via SSL, while specifying a minimum TLS version" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import redis\n", + "import ssl\n", + "\n", + "ssl_conn = redis.Redis(\n", + " host=\"localhost\",\n", + " port=6666,\n", + " ssl=True,\n", + " ssl_min_version=ssl.TLSVersion.TLSv1_3,\n", + ")\n", + "ssl_conn.ping()" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/docs/lua_scripting.rst b/docs/lua_scripting.rst index 0edb6b6723..bd7b9bc01d 100644 --- a/docs/lua_scripting.rst +++ b/docs/lua_scripting.rst @@ -92,19 +92,24 @@ Cluster Mode Cluster mode has limited support for lua scripting. -The following commands are supported, with caveats: - ``EVAL`` and -``EVALSHA``: The command is sent to the relevant node, depending on the -keys (i.e., in ``EVAL "