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

Add configurable progress and session info indicators #751

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

amitschang
Copy link

@amitschang amitschang commented Mar 10, 2022

Description

Configuration options are added to allow override of the spark statement progress indicator and for the html table of
session info upon startup. Both come with defaults that implement the same function as was done prior to this change, so
there would be no impact in case options are not set.

In my use-case, I wanted to create a indicator that sits at the top of the page and includes a link to the UI, and thus can be seen no matter where in the page your are focused. I think there are many other potential uses, such as users wanting to do simpler things like setting the width of the widget, or choosing a different widget for progress, etc.

Testing: Manually tested with notebook both without the new options and confirming the existing behavior and with overridden classes to customize both progress and startup display. Existing unit tests pass

Note: my editor is set to be opinionated about trailing white-space, so the PR includes some white-space fixes. I can certainly prune those out if it is not desired to include unrelated cleanup. Otherwise, the diff can be viewed with white-space hidden.

Checklist

  • Wrote a description of my changes above
  • Added a bullet point for my changes to the top of the CHANGELOG.md file
  • Added or modified unit tests to reflect my changes
  • Manually tested with a notebook
  • If adding a feature, there is an example notebook and/or documentation in the README.md file

Configuration options are added to allow override of the spark statement progress indicator and for the html table of
session info upon startup. Both come with defaults that implement the same function as was done prior to this change, so
there would be no impact in case options are not set.
@devstein devstein requested review from devstein, itamarst and PedroRossi and removed request for devstein and itamarst April 26, 2022 22:43
Copy link
Collaborator

@devstein devstein 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 contributing and the helpful PR description @amitschang! I'll try to review this week.

Copy link
Collaborator

@devstein devstein left a comment

Choose a reason for hiding this comment

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

Overall looks good. Just need to fix some issue around naming and class design

sparkmagic/sparkmagic/utils/progress.py Outdated Show resolved Hide resolved
sparkmagic/sparkmagic/utils/startupinfo.py Outdated Show resolved Hide resolved
sparkmagic/sparkmagic/utils/configuration.py Outdated Show resolved Hide resolved
sparkmagic/sparkmagic/utils/configuration.py Outdated Show resolved Hide resolved
sparkmagic/sparkmagic/utils/startupinfo.py Outdated Show resolved Hide resolved
@devstein
Copy link
Collaborator

@amitschang Merge conflicts from #758 an easy way to fix is

git remote add upstream git://github.com/jupyter-incubator/sparkmagic.git
git fetch upstream
# choose local changes over remotes
git merge upstream/master -X ours
# run black on all files
black .

@amitschang
Copy link
Author

Thanks @devstein! I will carve out some time to work on requested changes probably early next week, cheers :)

@amitschang
Copy link
Author

@devstein, I've addressed all your comments I believe. Please let me know what you think. I've also merged in the lastest upstream and ran black. There are still a small number of whitespace fixes left from my changes, for non-py files - I hope they are OK left in. The tests were added to the configuration tests since they have to to with default configuration and check whether the defaults are subclasses of the appropriate indicator classes (even though otherwise there is no attempt at enforcing this - which I think is probably OK).

@amitschang amitschang requested a review from devstein May 3, 2022 20:13
@amitschang
Copy link
Author

a bit of a bump on this. Still something you think could be included?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants