Skip to content

ENH: add warning stacklevel when surfacing warnings from gdal. #627

@m-richards

Description

@m-richards

In _err.pyx

cython
    if err_class == CE_Warning:
        with gil:
            warnings.warn(clean_error_message(err_msg), RuntimeWarning)
        return

warnings surfaced by GDAL are bubbled up through the python warning system. Ideally this should probably get a stacklevel argument back to the read file call rather than showing a trace to pyogrio internals. I'm not sure why there isn't a stacklevel currently, perhaps this is a case where it's not easy to deduce what hte stack level should be as it depends on how it is reached.

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