Chaffelson / nipyapi

A convenient Python wrapper for Apache NiFi
Other
244 stars 76 forks source link

create_funnel always creates funnel in default position #172

Closed sopermaf closed 4 years ago

sopermaf commented 4 years ago

https://github.com/Chaffelson/nipyapi/blob/1b315f0d4da6149687975c8d198bc9a6a187632b/nipyapi/canvas.py#L1504

The PositionDTO isn't passed to the component section and as a result the funnel position can't be set when using canvas.create_funnel

Quoted problem line above and a solution below:

    with nipyapi.utils.rest_exceptions():
        return nipyapi.nifi.ProcessGroupsApi().create_funnel(
            id=pg_id,
            body=nipyapi.nifi.FunnelEntity(
                position=nipyapi.nifi.PositionDTO(
                    x=float(position[0]),
                    y=float(position[1])
                ),
                revision=nipyapi.nifi.RevisionDTO(version=0),
                component=nipyapi.nifi.FunnelDTO(
                    parent_group_id=pg_id,
                    position=nipyapi.nifi.PositionDTO(
                        x=float(position[0]),
                        y=float(position[1])
                    ),
                )
            )
        )
Chaffelson commented 4 years ago

Resolved in current master, will be in next release.

Geocali commented 3 years ago

In the version 0.14.3, create_funnel still returns a position of (0, 0)

Fixed in pull request #224