Skip to content

minor update by agents - #305

Merged
shaypal5 merged 33 commits into
masterfrom
update/agents
Jan 22, 2026
Merged

shaypal5 merged 33 commits into
masterfrom
update/agents

Conversation

@Borda

@Borda Borda commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Ran some automatic issue fixing...

@Borda
Borda requested a review from shaypal5 as a code owner October 2, 2025 09:34
@shaypal5

shaypal5 commented Nov 2, 2025

Copy link
Copy Markdown
Member

Hey @Borda , I see this is not a draft.
Is this waiting for my review?
If so:

  1. There are conflicts in tests/test_pickle_core.py that require solving.
  2. Please make sure that codecov coverage warnings are false positives, or make them go away.

Cheers!

@Borda

Borda commented Jan 1, 2026

Copy link
Copy Markdown
Contributor Author

@shaypal5 can we roll back the deployment on PR if is not needed, since it makes PR super noisy and impossible to navigate in past comments...

@Borda

Borda commented Jan 1, 2026

Copy link
Copy Markdown
Contributor Author

About the codecov, it reports too early, even before any test finishes, so for sure it will need to be fixed, but I would make it in a separate PR to keep the changes focused

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Comment thread src/cachier/cores/redis.py
return None

@staticmethod
def _get_raw_field(cached_data, field: str):

Copilot AI Jan 2, 2026

Copy link

Choose a reason for hiding this comment

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

The static method _get_raw_field is missing a type annotation for the cached_data parameter. Based on the implementation, it should be typed as something like Dict[Union[bytes, str], Any] or a more specific type. The coding guidelines require "all new code must include full type annotations."

Copilot generated this review using guidance from repository custom instructions.
return cached_data.get(field)

@staticmethod
def _get_bool_field(cached_data, name: str) -> bool:

Copilot AI Jan 2, 2026

Copy link

Choose a reason for hiding this comment

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

The static method _get_bool_field is missing a type annotation for the cached_data parameter. It should be typed consistently with _get_raw_field. The coding guidelines require "all new code must include full type annotations."

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +76 to +122
@staticmethod
def _loading_pickle(raw_value) -> Any:
"""Load pickled data with some recovery attempts."""
try:
if isinstance(raw_value, bytes):
return pickle.loads(raw_value)
elif isinstance(raw_value, str):
# try to recover by encoding; prefer utf-8 but fall
# back to latin-1 in case raw binary was coerced to str
try:
return pickle.loads(raw_value.encode("utf-8"))
except Exception:
return pickle.loads(raw_value.encode("latin-1"))
else:
# unexpected type; attempt pickle.loads directly
try:
return pickle.loads(raw_value)
except Exception:
return None
except Exception as exc:
warnings.warn(
f"Redis value deserialization failed: {exc}",
stacklevel=2,
)
return None

@staticmethod
def _get_raw_field(cached_data, field: str):
"""Fetch field from cached_data with bytes/str key handling."""
# try bytes key first, then str key
bkey = field.encode("utf-8")
if bkey in cached_data:
return cached_data[bkey]
return cached_data.get(field)

@staticmethod
def _get_bool_field(cached_data, name: str) -> bool:
"""Fetch boolean field from cached_data."""
raw = _RedisCore._get_raw_field(cached_data, name) or b"false"
if isinstance(raw, bytes):
try:
s = raw.decode("utf-8")
except Exception:
s = raw.decode("latin-1", errors="ignore")
else:
s = str(raw)
return s.lower() == "true"

Copilot AI Jan 2, 2026

Copy link

Choose a reason for hiding this comment

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

The docstrings for the new static methods (_loading_pickle, _get_raw_field, _get_bool_field) do not follow numpy docstring conventions as required by the coding guidelines. Numpy-style docstrings should include sections like Parameters, Returns, and potentially Notes or Examples. For example, _loading_pickle should document the raw_value parameter, describe what it returns, and explain the recovery attempts it makes.

Copilot generated this review using guidance from repository custom instructions.
Comment thread src/cachier/core.py
Comment thread src/cachier/cores/base.py
Comment thread tests/test_pickle_core.py
Comment thread .pre-commit-config.yaml
- id: ruff
name: Ruff check
args: ["--fix"]
args: ["--fix"] #, "--unsafe-fixes"

Copilot AI Jan 2, 2026

Copy link

Choose a reason for hiding this comment

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

The commented-out --unsafe-fixes argument suggests that unsafe fixes were considered but not enabled. While commenting is fine for documentation, it would be clearer to either remove the comment entirely or add an explanatory comment about why unsafe fixes are not enabled. The current inline comment without explanation may cause confusion for future maintainers.

Suggested change
args: ["--fix"] #, "--unsafe-fixes"
args: ["--fix"] # Unsafe fixes are intentionally disabled in CI; add "--unsafe-fixes" locally if you accept the risk.

Copilot uses AI. Check for mistakes.
@Borda

Borda commented Jan 3, 2026

Copy link
Copy Markdown
Contributor Author

@shaypal5 seems all is green :)

This branch was previously deployed

1 inactive deployment
test — b7deae23 Deployed Jan 3, 2026 by Borda via pytester (3.13, ubuntu-latest, local) #549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: config Global/default configuration and settings. area: core-api Decorator API, cache semantics, or public behavior. area: redis Redis backend or Redis test services. CI outcome: merged Merged into the repository. size: medium Medium PR by changed-file count. source: human Opened directly by a human contributor. type: ci GitHub Actions, CI configuration, or automation workflow change. type: tests Tests, fixtures, test coverage, or test data.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants