Skip to content

Generated facade code types are too wide #1249

Open
@dimaqq

Description

@dimaqq

Description

According to
https://github.com/dimaqq/juju-schema-analysis/blob/0acd07573bb2c192785796381f0594470ef296d8/schemas-juju-3.6.0.model-user.txt#L741C1-L753C12

Application.Get().charm is an str

However, the generated facade code accepts None|str|bytes:

if charm_ is not None and not isinstance(charm_, (bytes, str)):
raise Exception(f"Expected charm_ to be a str, received: {type(charm_)}")

The type checker rightfully infers None|str|bytes for the .charm attribute.

Urgency

Casually reporting

Python-libjuju version

3.6.1.0

Juju version

any

Reproduce / Test

charm_name: str = (await Application.Get()).charm

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugindicates a bug in the project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions