Skip to content

[ Refactor ] Depreciated API Warnings #35

@mahimairaja

Description

@mahimairaja

Summary of the issue

Just showing the warning might not sufficient, atleast in python environment.

warnings.warn(
"create_namespace is deprecated and will be removed in a future version. "
"Use client.namespaces.create instead.",
DeprecationWarning,
stacklevel=2,
)

python interpreter ignore the warnings by default to end users, it may cause unintended frustrations to the team using deprecated methods.

Suggested solution:

Defining a custom warning would help avoiding the ignorance

import warnings

class MethodDeprecationWarning(UserWarning):
    pass

warnings.warn(
    "create_namespace() is deprecated",
    category=MethodDeprecationWarning,
    stacklevel=2
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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