taipy
taipy copied to clipboard
BUG- `taipy migrate` is not working for taipy 3.1.0
Description
When upgrading Taipy version, the user should be able to use taipy migrate command to upgrade taipy entities to work with the new version as well. However, the script is failing when upgrading entities from 3.1.0.dev0 to 3.2.0.dev0.
taipy migrate --repository-type filesystem
[2024-03-06 22:20:23][Taipy][INFO] Backed up entities from '.taipy/' to '.taipy/_backup' folder before migration.
[2024-03-06 22:20:23][Taipy][INFO] Starting entity migration from '.taipy/' folder.
[2024-03-06 22:20:23][Taipy][INFO] Migrating SCENARIOS
Traceback (most recent call last):
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/bin/taipy", line 8, in <module>
sys.exit(_entrypoint())
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/lib/python3.10/site-packages/taipy/_entrypoint.py", line 56, in _entrypoint
_MigrateCLI.parse_arguments()
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/lib/python3.10/site-packages/taipy/core/_entity/_migrate_cli.py", line 82, in parse_arguments
cls.__migrate_entities(repository_type, repository_args, do_backup)
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/lib/python3.10/site-packages/taipy/core/_entity/_migrate_cli.py", line 125, in __migrate_entities
if not _migrate_fs_entities(path, do_backup):
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/lib/python3.10/site-packages/taipy/core/_entity/_migrate/_migrate_fs.py", line 113, in _migrate_fs_entities
entities, _ = _migrate(entities)
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/lib/python3.10/site-packages/taipy/core/_entity/_migrate/_utils.py", line 303, in _migrate
entities = __migrate_entities("SCENARIO", entities)
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/lib/python3.10/site-packages/taipy/core/_entity/_migrate/_utils.py", line 287, in __migrate_entities
v["data"] = migration_fct(v["data"], data) # type: ignore
File "/Users/trgiangdo/.local/share/virtualenvs/test-taipy-lMxhkYIZ/lib/python3.10/site-packages/taipy/core/_entity/_migrate/_utils.py", line 95, in __migrate_scenario
scenario["tasks"] = __fetch_tasks_from_pipelines(scenario["pipelines"], data)
KeyError: 'pipelines'
Expected behavior
- The command should be better tested and work for different taipy version
- The
ConfigCoreVersionMismatchedexception should suggest the user to run the command to upgrade entities.
Acceptance Criteria
- [ ] Ensure new code is unit tested, and check code coverage is at least 90%
- [ ] Create related issue in taipy-doc for documentation and Release Notes if relevant