def METHOD_NAME(obj: str) -> datetime:
    if obj.endswith('Z'):
        # Backwards compatibility for data encoded with previous dlt version
        # fromisoformat does not support Z suffix (until py3.11)
        obj = obj[:-1] + '+00:00'
    return pendulum.DateTime.fromisoformat(obj)  # type: ignore[attr-defined, no-any-return]