Skip to content

Exception when reading empty array of variants #1862

@olofos

Description

@olofos

We have a server which produces objects containing an array of BaseDataType. Depending on the circumstances these can be of a few different types. This mostly works fine with clients written in asyncua. However sometimes the array is simply empty, so the server returns an array of dimension 0. This leads to an exception "could not guess UA type of variable []" on line 1000 of ua/uatypes.py. The check around there in the code looks weird to me. Why does it matter what the type is if the array is empty? Can't we just set it to eg null. From the spec I also don't see anything wrong with having an empty array of variants like this

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