ni / ni/measurement-plugin-python

The `display_name` parameter is misleadingly named

Open
#336 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
21
Forks
20
Avg merge
1d 16h
Merged PRs (30d)
3

Description

Bug Report

The MeasurementService.configuration and MeasurementService.output methods have a display_name parameter, which is not the display name but rather the Protobuf field name. The display name is provided by the UI file, and is not required to match the Protobuf field name.

Repro or Code Sample

https://github.com/ni/measurementlink-python/blob/main/ni_measurementlink_service/measurement/service.py#L233

    def configuration(
        self,
        display_name: str,
        type: DataType,
        default_value: Any,
        *,
        instrument_type: str = "",
        enum_type: Optional[Type[Enum]] = None,
    ) -> Callable:

Expected Behavior

Parameter name correctly describes its function.

Current Behavior

Parameter name incorrectly describes its function.

Possible Solution

Rename parameter to name.

Add a keyword-only parameter with the old name (display_name) which defaults to None. If display_name is specified, override name and generate a deprecation warning.

Your Environment

  • OS & Device: Windows
  • ni-measurementlink-service version: 1.0 through 1.2.0-dev0
  • MeasurementLink version: N/A
  • Python version: N/A

AB#2457655

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read ni_measurementlink_service/measurement/service.py around line 233 and inspect both MeasurementService.configuration and MeasurementService.output. Rename the misleading parameter while preserving the old display_name keyword as a deprecated override, and verify both methods expose the corrected behavior and warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.