Python transforms - "cannot import 'datasets' from 'myproject'" on folder name change

I’m getting the error cannot import 'datasets' from 'myproject' after having changing the name of the project folder structure from datasets to something else.

I’m writing python transforms in a code repository.

How can I fix this error ?

Let’s assume you had transforms-python/src/myproject/datasets and you changed it to transforms-python/src/new_project/my_folder.

2 files in a python code repository need to change once and if you change the folder structure:

  • pipeline.py ==> This files auto-detect the transforms in the tree of files, starting from a particular folder. You will nee to change the import statement, so that it crawl the directories and files from the new folder you created.

e.g. instead of

from myproject import datasets
# [...]
my_pipeline.discover_transforms(datasets)

you will need

from new_project import my_folder
# [...]
my_pipeline.discover_transforms(my_folder)
  • setup.py ==> this references the pipeline.py as an entry point.

e.g. instead of

root = myproject.pipeline:my_pipeline

you will need

root = new_project.pipeline:my_pipeline