Skip to content

Test case for v2 client #61

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Test case for v2 client #61

wants to merge 18 commits into from

Conversation

blast-hardcheese
Copy link
Contributor

No description provided.

offset = e.colno - 1
first = json.loads(line[0:offset])
if "hijack" not in first:
logging.warning("Working around docker 'hijack' message")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling for the Docker 'hijack' message appears inconsistent. In the read_from_stdin() function, when a JSON decode error occurs, the code logs a warning with "Working around docker 'hijack' message" but doesn't verify that 'hijack' is actually present before proceeding. This contrasts with line 81 which uses assert "hijack" in first.

Consider either:

  1. Adding proper validation before the warning message: if "hijack" in first: logging.warning(...)
  2. Using a try/except block to handle the case where 'hijack' isn't present
  3. Removing the warning and letting the assertion handle the error case

This would make the error handling more robust and consistent.

Suggested change
logging.warning("Working around docker 'hijack' message")
if "hijack" in first:
logging.warning("Working around docker 'hijack' message")

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

version = "1.0.0"
description = "River toolkit for Python"
readme = "README.md"
requires-python = ">=3.12"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a version mismatch between the pyproject.toml file which requires Python ≥3.12 and the client.dockerfile which uses Python 3.11. This could lead to runtime issues or dependency conflicts. Consider either:

  1. Updating the dockerfile to use Python 3.12+:

    FROM python:3.12-slim-bookworm
  2. Or adjusting the pyproject.toml requirements to match the Docker environment:

    requires-python = ">=3.11"

Ensuring version consistency will help prevent potential deployment problems.

Suggested change
requires-python = ">=3.12"
+requires-python = ">=3.11"

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant