Closed AlexandreSajus closed 11 months ago
Assume that there is a main.py
file containing a preprocessing()
method.
When choosing a function to configure a new task, the main.py
module is replaced by __main__
module.
I propose we can:
__main__
by the main.py
(when choose __main__
module, the actual module in the TOML file will be main.py
).__main__
or main.py
.Also, there can be a hidden bug to this.
Assume that the project has:
app.py
file which runs Taipy services, andutils.py
file which contains the methods for tasks.Sometimes there can be a confusion of which file is actually the __main__
module.
Like in this case, the utils.py
is now the __main__
module.
in studio, the user can specify which is the main module: right click in the file explorer view :-)
Allow the user to either choose main or main.py
I think that would be the easiest solution for everyone.
in studio, the user can specify which is the main module: right click in the file explorer view :-)
Oh, I did not know that. Sorry 🥲
Allow the user to either choose main or main.py
I think that would be the easiest solution for everyone.
Yes I agree. Let's discuss with the CS team
Description When selecting a function coming from main.py in a task node in Taipy Studio, it will define it in the config as main .function When running Taipy Core in Python scripts, taipy understands that main is in main.py When running in a notebook, taipy does not find the function![image](https://github.com/Avaiga/taipy-core/assets/62465003/737e7fc7-bd1a-46ea-b58e-abf31ce35e46)
How to reproduce
Create a main.py with a function. Create a config with a task node calling that function: the config will save it as main .function Run the scenario inside a notebook; the notebook should return an error explaining that module main has no attribute function.
Expected behavior Don't convert main.py to main inside the config file, or help notebooks recognize that main can be the main.py file.
Runtime environment Please specify relevant indications.