Skip to content

Change warning condition on loading object saved under different library version #1270

Open
Mr-Geekman opened this issue May 25, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers priority/low Low priority task

Comments

@Mr-Geekman
Copy link
Contributor

🚀 Feature Request

Currently we have this condition on loading object saved under different library version:

        if current_etna_version[0] != saved_etna_version[0] or current_etna_version[:2] < saved_etna_version[:2]:
            current_etna_version_str = ".".join([str(x) for x in current_etna_version])
            saved_etna_version_str = ".".join([str(x) for x in saved_etna_version])
            warnings.warn(
                f"The object was saved under etna version {saved_etna_version_str} "
                f"but running version is {current_etna_version_str}, this can cause problems with compatibility!"
            )

We should simplify this condition and give a warning if version is different: current_etna_version != saved_etna_version, because we don't have forward or backward compatibility for saving.

Proposal

Change the condition in

  • etna.core.mixins.SaveMixin._validate_metadata

Test cases

Fix tests:

  • tests.test_core.test_mixins.test_save_mixin_load_warning
    • Add params (1, 5, 0), (1, 3, 0)
    • Add params (1, 5, 0), (1, 5, 1)
    • Add params (1, 5, 1), (1, 5, 0)
  • tests.test_pipeline.test_save_mixin_load_warning
    • Same
  • tests.test_ensembles.test_save_mixin_load_warning
    • Same
  • tests.test_models.test_save_mixin_load_warning
    • Same

Additional context

No response

@Mr-Geekman Mr-Geekman added enhancement New feature or request good first issue Good for newcomers labels May 25, 2023
@github-project-automation github-project-automation bot moved this to Specification in etna board May 25, 2023
@Mr-Geekman Mr-Geekman moved this from Specification to Todo in etna board May 26, 2023
@Mr-Geekman Mr-Geekman added the priority/low Low priority task label Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers priority/low Low priority task
Projects
Status: Todo
Development

No branches or pull requests

1 participant