Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable _clear_state and ensure test independence #120

Merged
merged 15 commits into from
Oct 23, 2023

Conversation

maxschulz-COL
Copy link
Contributor

@maxschulz-COL maxschulz-COL commented Oct 19, 2023

Description

  • implement the private _clear_state function as suggested by @ned2
  • apply to all tests to ensure test independence
  • adjust preliminary warnings that guide towards this solution if cells are re-evaluated in Jupyter
  • Replace tech_logos.png

Screenshot

Checklist

  • I have not referenced individuals, products or companies in any commits, directly or indirectly
  • I have not added data or restricted code in any commits, directly or indirectly
  • I have updated the docstring of any public function/class/model changed
  • I have added the PR number to the change description in the changelog fragment, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) (if applicable)
  • I have added tests to cover my changes (if applicable)

Types of changes

  • Docs/refactoring (non-breaking change which improves codebase)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

@maxschulz-COL maxschulz-COL added Status: Ready for Review ☑️ Issue/PR is ready for review - all tests have passed Issue: Bug Report 🐛 Issue/PR that report/fix a bug labels Oct 19, 2023
@maxschulz-COL maxschulz-COL marked this pull request as ready for review October 19, 2023 11:10
@maxschulz-COL maxschulz-COL linked an issue Oct 19, 2023 that may be closed by this pull request
1 task
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you two for fixing @maxschulz-COL @ned2! 🚀

@maxschulz-COL - could you add @ned2 to our list of contributors in our authors.md file to give him credits for the proposed solution?

vizro-core/src/vizro/_vizro.py Outdated Show resolved Hide resolved
vizro-core/tests/unit/vizro/conftest.py Outdated Show resolved Hide resolved
vizro-core/src/vizro/_vizro.py Outdated Show resolved Hide resolved
@huong-li-nguyen huong-li-nguyen added the Component: Tests 🧪 Issue/PR that address test framework label Oct 19, 2023
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up! 🧹 🔥

vizro-core/src/vizro/_vizro.py Outdated Show resolved Hide resolved
vizro-core/src/vizro/_vizro.py Outdated Show resolved Hide resolved
vizro-core/tests/conftest.py Outdated Show resolved Hide resolved
vizro-core/tests/unit/vizro/conftest.py Show resolved Hide resolved
Copy link
Contributor

@antonymilne antonymilne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix @maxschulz-COL and @ned9!

I just have a couple of small comments and one concern about the test fixture but otherwise looks great 💯

In the near future I think we might want to move some of this resetting behaviour so it always runs automatically in our Vizro.__init__ or similar, and also make the rest that's left in Vizro._reset into public API. This can be handled as part of #111 because it's all related.

vizro-core/tests/conftest.py Outdated Show resolved Hide resolved
vizro-core/src/vizro/_vizro.py Outdated Show resolved Hide resolved
vizro-core/tests/conftest.py Show resolved Hide resolved
vizro-core/src/vizro/_vizro.py Outdated Show resolved Hide resolved
Copy link
Contributor

@petar-qb petar-qb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good!

maxschulz-COL and others added 2 commits October 20, 2023 15:11
Co-authored-by: Antony Milne <49395058+antonymilne@users.noreply.github.com>
Signed-off-by: Maximilian Schulz <83698606+maxschulz-COL@users.noreply.github.com>
@maxschulz-COL maxschulz-COL merged commit f391d06 into main Oct 23, 2023
25 checks passed
@maxschulz-COL maxschulz-COL deleted the bug/implement_improved_clearing branch October 23, 2023 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Tests 🧪 Issue/PR that address test framework Issue: Bug Report 🐛 Issue/PR that report/fix a bug Status: Ready for Review ☑️ Issue/PR is ready for review - all tests have passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rerun Vizro Dashboard in Jupyter doesn't work
4 participants