Skip to content

Backward compatible class replaced by a function #280

@gsnider2195

Description

@gsnider2195

The diffsync.DiffSync class was changed to a function

def DiffSync(*args: Any, **kwargs: Any) -> Adapter: # noqa pylint: disable=invalid-name
"""For backwards-compatibility, keep around the old name."""
warnings.warn(
"'diffsync.DiffSync' is deprecated and will be removed with 2.1, use 'diffsync.Adapter' instead.",
DeprecationWarning,
)
return Adapter(*args, **kwargs)

This causes the import of any class using this as a base class to fail:

import diffsync


class TestAdapter(diffsync.DiffSync):
    """A simple DiffSync adapter for testing purposes."""
Traceback (most recent call last):
  File "/home/gary/github/nautobot/nautobot-app-device-onboarding/test_diffsync.py", line 4, in <module>
    class TestAdapter(diffsync.DiffSync):
TypeError: function() argument 'code' must be code, not str

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions