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

Upgrade dashboard interaction issue #1249

Closed
wants to merge 7 commits into from
Closed

Upgrade dashboard interaction issue #1249

wants to merge 7 commits into from

Conversation

joshuayhwu
Copy link
Contributor

Fixes #1246

  • Resolve callback functions not working with newer versions of dash/gunicorn with flask
  • All PR Status checks are successful
  • Peer reviewed and approved

Any questions? See the getting started guide

@joshuayhwu joshuayhwu requested a review from nichhk June 15, 2022 01:52
@joshuayhwu joshuayhwu changed the title Upgrade dashboard Upgrade dashboard interaction issue Jun 15, 2022
@joshuayhwu
Copy link
Contributor Author

joshuayhwu commented Jun 15, 2022

There seems to be some issues with automatic checks on alembic. I am not entirely sure why. Could this be something to do with database recreation in order to fix the v1 site (Issue #1239 ? )

@nichhk
Copy link
Member

nichhk commented Jun 21, 2022

Hey I just reran the test, and it passed successfully. I guess the database wasn't initialized properly in your run. The test brings up a local database, so we wouldn't expect any issues with the prod database to affect it.

I'll start reviewing these changes now, thanks!

Copy link
Member

@nichhk nichhk 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 figuring this out Josh!

I mentioned this in the comments, but Piero is actively working on updating neighborhoods.py in PR #1242. Let's wait for him to merge that before applying the Dash upgrade to that file.

In general, my comments are about Python style. In particular, we should use snake_case for variable names. We should also organize imports as described here: https://google.github.io/styleguide/pyguide.html#313-imports-formatting.

server/dash/app.py Show resolved Hide resolved

external_stylesheets = ['/static/reports.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
server = flask.Flask(__name__) # define flask app.server
Copy link
Member

Choose a reason for hiding this comment

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

The comment here is not informative beyond the code itself, so we can get rid of it.

server/dash/dashboards/ncSumComp.py Show resolved Hide resolved
import textwrap

import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
Copy link
Member

Choose a reason for hiding this comment

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

Ditto, please follow guidelines for import formatting here: https://google.github.io/styleguide/pyguide.html#313-imports-formatting

server/dash/dashboards/neighborhood.py Show resolved Hide resolved
import textwrap

import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
Copy link
Member

Choose a reason for hiding this comment

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

Ah, I just remembered that Piero is updating this file right now. Let's wait until he merges his PR, and then could you pull and update the dash stuff please?

server/dash/index.py Show resolved Hide resolved
from dash.dependencies import Input
from dash.dependencies import Output
from dash import Dash, html, dcc, callback, Input, Output
# from dash.dependencies import Input, Output
Copy link
Member

Choose a reason for hiding this comment

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

remove?

server/dash/dashboards/neighborhood_recent.py Show resolved Hide resolved
BATCH_SIZE = 10000

def batch_get_data(url):
# set up your query
Copy link
Member

Choose a reason for hiding this comment

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

Please capitalize the start of all comments, and add a period at the end.

@nichhk
Copy link
Member

nichhk commented Jun 21, 2022

Could you use an autoformatter for Python in your code editor? I think that will help with some of the style issues like spacing.

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.

Plotly Dash Versioning Issue
2 participants