Skip to content

Plugin expressions don't handle keyboard interrupts (CTRL+C) #127

Open
@sclamons

Description

@sclamons

Long-running plugin expressions can hog the terminal and can't be interrupted by keyboard interrupt. This is a known phenomenon with PyO3: https://pyo3.rs/v0.23.3/faq.html. Recommended practice is for long-running functions to occasionally call Python::check_signals(), which lets the Python interpreter check for SIGINT and other signals; but I can't find a way to do that from a Polars plugin, where you don't typically have access to a Python object.

It would be really nice for PyO3-polars to handle SIGINT checking behind the scenes. Barring that, can we somehow allow access to the Python object that ultimately gets used in the call? If there's already a way to do this, it needs to be documented (or documented better).

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