Skip to content

ENH: consistent reporting and exit codes for pytensor-cache clear and unlock #2534

Open

Description

@williambdean

Description

Observed behavior across the mutating commands:

  • clear prints nothing on success; it warns only when tmp* entries remain.
  • unlock prints "Lock successfully removed!" even when no lock existed (verified: exit 0).
  • clear and cleanup exit 0 even when delete_if_problem=True leaves files behind.

So some commands report their outcome and some do not, and the exit code does not distinguish full success from partial success.

Proposal

Make outcome reporting consistent across commands:

  • Every command reports what it did in the same style: action taken, count/bytes where applicable.
  • unlock: distinguish "no lock found" from "removed stale lock".
  • Exit codes reflect the outcome: nonzero on partial failure.

Reporting goes to stderr per #2531; data summaries on stdout.

Activity

  1. ricardoV94 commented on Oct 20, 2026

    @ricardoV94
    Member

    @williambdean can you combine your pytensor-cache issuse/suggestions in one, I don't think we need 10 of them

  2. williambdean commented on Oct 20, 2026

    @williambdean
    ContributorAuthor

    I will keep them separate but make a parent issue

  3. ricardoV94 commented on Oct 20, 2026

    @ricardoV94
    Member

    😢 So many email notifications...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions