Avaiga / taipy-core

A Python library to build powerful and customized data-driven back-end applications.
Apache License 2.0
39 stars 15 forks source link

BUG: the parameter --taipy-force is broken #648

Closed jrobinAV closed 1 year ago

jrobinAV commented 1 year ago

The --taipy-force option does not work.

jeanrobin@LAPTOP-RPTO2SFK MINGW64 ~/workspace/demos/scenario
$ python main.py --production 2.0 --taipy-force
[2023-06-18 17:00:06][Taipy][INFO] No scenario comparators defined for ScenarioConfig `scenario_configuration`.
[2023-06-18 17:00:06][Taipy][INFO] There are non-conflicting changes between the version 1.0 Configuration and the current Configuration:
        CORE "version_number" was modified: 1.0 -> 2.0
        CORE "force" was modified: False:bool -> True:bool
[2023-06-18 17:00:06][Taipy][ERROR] The version 1.0 Configuration is conflicted with the current Configuration:
        DATA_NODE "replacement_type" has attribute "default_value" added: DEFAULT
[2023-06-18 17:00:06][Taipy][ERROR] To force running the application with the changes, run your application with --taipy-force option.
The application is stopped. Please check the error log for more information.
trgiangdo commented 1 year ago
  1. The "force" parameter appears under INFO section, which means that it is a "non-conflicting change". If I get your message correctly, you want to keep the "version_number" change in the INFO, but remove "force" right? That would require an exception since both are on the CoreSection.
  2. My guess is that the --taipy-force is failing here because the production version 1.0 is conflict with the current Configuration. On 2.3, we do not provide any migration method yet, so it is supposed to fail.
trgiangdo commented 1 year ago

To resolve the second point, I added 2 PRs to improve the error message. It will be something like

$ python3 main.py --production "2.0"
[2023-06-21 10:41:57][Taipy][INFO] No scenario comparators defined for ScenarioConfig `s`.
[2023-06-21 10:41:57][Taipy][INFO] There are non-conflicting changes between the version 1.0 Configuration and the current Configuration:
        CORE "mode" was modified: experiment -> production
        CORE "version_number" was modified: 1.0 -> 2.0
[2023-06-21 10:41:57][Taipy][ERROR] The version 1.0 Configuration is conflicted with the current Configuration:
        DATA_NODE "b" has attribute "default_data" added: b
[2023-06-21 10:41:57][Taipy][ERROR] Please remove version 1.0 from production to avoid conflict.

The production version 1.0 is still blocked from running, since there is conflict.

jrobinAV commented 1 year ago

What is wrong, according to me, is that I am running the app with --taipy-force, and there is an error message saying I should run it with --taipy-force. This is inconsistent. Should we replace the error message with a Warning saying: "Conflicting changes have been detected but option --force is used. The application runs anyway."

trgiangdo commented 1 year ago

So instead of blocking the application from running, we let the user run it right? Working on it.

jrobinAV commented 1 year ago

If --taipy-force is True, yes.

trgiangdo commented 1 year ago

So about the first point

Right now, when there is unconflicted change (in sections Job, GUI, CoreSection), the change is still shown in the terminal. My question is: Should we add another layer for the _CoreSection to hide it entirely, or should we hide all unconflicted sections?

jrobinAV commented 1 year ago

I believe we can keep them. They are just INFO anyway.