Skip to content

feature: raise error when updating read-only attribute in SDK #1248

Description

@ajtmccarty

Component

Python SDK

Describe the Feature Request

We should raise an error of some sort when attempting to update a read-only attribute via the SDK

Describe the Use Case

The current approach for handling read-only-attribute updates in the SDK is to silently fail by not updating the read-only attribute. A better approach would be to raise a warning or an error when the read-only attribute is updated.

Additional Information

Patrick suggested making this change in python_sdk.infrahub_sdk.node.Attribute

What we could do is to convert self.value to a property setter that after initialized would produce a warning if anyone tried to update read_only values.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions