code-kern-ai / refinery

The data scientist's open-source choice to scale, assess and maintain natural language data. Treat training data like a software artifact.
https://www.kern.ai
Apache License 2.0
1.39k stars 66 forks source link

[BUG] - Lookup lists that are not valid Python variable names break the labeling function calculation #221

Closed DerEchteFeuerpfeil closed 1 year ago

DerEchteFeuerpfeil commented 1 year ago

Describe the bug Lookup lists that are not valid variable names break the labeling function calculation even when they are not used. When I removed the list called "123" (see screenshot), the calculation worked again.

To Reproduce Steps to reproduce the behavior:

  1. Create a lookup list called "123"
  2. Import some list (dsnt have to be the 123 one) from knowledge in a LF
  3. Run it
  4. See error

Expected behavior Either I shouldnt be able to create such list names or the execution environment should preface the list name with something viable like "list_"

Screenshots image

Desktop (please complete the following information):

Additional context

JWittmeyer commented 1 year ago

possible solution could be to enhance the toPythonFunctionName function and match the logic to the backend version. Also important to note is that there is a second function currently in use which works slightly different and should be replaced asPythonVariable