Datatamer / tamr-client

Programmatically interact with Tamr
https://tamr-client.readthedocs.io
Apache License 2.0
11 stars 25 forks source link

`project.by_name` gets projects by internal name instead of name displayed in Tamr UI #458

Open skalish opened 4 years ago

skalish commented 4 years ago

🐛 bug report

The current implementation of the function tamr_client.project.by_name uses a the GET /v1/projects with a filter on the "name" property. In the filter this name is the internal name of the project and not the name displayed in the UI (the displayName. Confusingly, the returned project JSON object has a "name" property that is the displayName.

😯 Current Behavior

For example, if a project was created with the name "project_name" and then renamed to "project_display_name":

🤔 Expected Behavior

There should be a way of getting a project by its displayName since this (and to a lesser extent resourceId) is the only thing identifying a project in the UI.

💁 Possible Solution

This is a manifestation of the design of the versioned API design and the issue could be fixed there, however a possible workaround in tamr_client is:

The current implementation of by_name which actually retrieves a project by the internal "name" could be changed to a hidden/power-user function _by_name and a new by_name function could be defined that streams all projects and returns the one that matches on displayName ("name" in the returned JSON).

skalish commented 3 years ago

To conform with the intended design of this package as an interface to the APIs, it is more appropriate that the core issue here be solved in the API rather than by tamr-client. The workaround suggested under Possible Solution is better left as the recommended way to use the currently-available functionality to get a project by its display name.