Skip to content

Code generator does not create some imports #974

@lars-reimann

Description

@lars-reimann

Describe the bug

Declarations in the safeds package or any subpackage are always available. If explicit imports are missing, however, no imports are created in the Python code. This also leads to failures in the runner: "name 'Table' is not defined".

To Reproduce

Safe-DS:

package test

pipeline myPipeline {
    val table = Table.fromColumns([]);
}

Python:

# Pipelines --------------------------------------------------------------------

def myPipeline():
    table = Table.from_columns([])

Expected behavior

The following code should be created:

# Imports ----------------------------------------------------------------------

from safeds.data.tabular.containers import Table

# Pipelines --------------------------------------------------------------------

def myPipeline():
    table = Table.from_columns([])

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions