Skip to content

Manipulating attributes of an instance resulting from the instances() function will throw an error on computed properties #1959

Open
@spastorclovr

Description

@spastorclovr

Bug Report

1. Minimal reproduce step (Required)

https://play.kcl-lang.io/?s=M4YwFgpgtghgBADQE4BM4G0AeqD6BrASwDsUAaAcyQHsBXAB1JABsYCpgBeAMRieAgC6ALgBQccXBh0CANQhJgBKkSHAALkjgc4AIikEImNRCKLlwAHQhqwYHRZEIFpQHoAbgEYdYiYRKqNLV0AYSooOipFYwAlCGBaJBAIABEIADNiAjUlIm8JOCgINRgUGGKhOABvdSQApABfIMqffLgiGEKOHQASSuwUfGIUCyYqAHd5AAoASnqLXspaOnq8iXqWuDsIEArqjSFG7WbWiUX6ILO6Dfz2wuAm65O4PzRtfsGSR-F1jZ+cKToOH6QWQKEmOgQ0QAgnQ6DpSLoAZZLhZjOAdNMqhstiALG55GZTEF0F8sU9WrcIEEdJ5eHQwDAvKT1vkBCIfiJiOoYEQkvdtKDnKZiry4jMRCIcFyRUkgtKeXz0AAGNmS+WiiwvanBAASUIAcgBxACiyR0QA

  • Define a Schema with some attributes being "computed" (here it is a lower() call + some concatenation)
  • Create an instance
  • USe Schame.instances() to retrieve the instances
  • Change one attribute of the retrieved instance

2. What did you expect to see? (Required)

I am expecting to be able to change the "kind" attribute.

3. What did you see instead (Required)

invalid value 'NoneType' to load attribute 'lower'

4. What is your KCL components version? (Required)

0.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions