Skip to content

sre_parse raises DeprecationWarning #1054

@pvk-developer

Description

@pvk-developer

Environment Details

  • RDT version: 1.18.2
  • Python version: 3.12+
  • Operating System: Any

Description

The sre_parse module is deprecated and will be removed from Python in future versions (see Python Deprecations). Our libraries are currently raising DeprecationWarning due to usage of this module.

In Python 3.13, sre_parse.py has been updated to emit a deprecation warning and simply re-export everything from re._parser:

import warnings
warnings.warn(f"module {__name__!r} is deprecated",
              DeprecationWarning,
              stacklevel=2)

from re import _parser as _
globals().update({k: v for k, v in vars(_).items() if k[:2] != '__'})

This indicates that sre_parse is now just a compatibility shim for re._parser.

Proposed Solution

Update rdt/transformers/utils.py to import directly from re._parser instead of sre_parse:

Replace:

import sre_parse

With:

from re import _parser

Then update all references to sre_parse throughout the codebase to use _parser instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginternalThe issue doesn't change the API or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions