Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
format/lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Rivet committed Mar 6, 2020
1 parent 76a9465 commit a77b159
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = E203, E266, E501, E731, W503
ignore = C901, E203, E266, E501, E731, W503
max-line-length = 88
max-complexity = 18
select = B,C,E,F,W,T4
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"private::build:py": "dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json && cp dash_table_base/** dash_table/ && dash-generate-components src/dash-table/dash/DataTable.js dash_table -p package-info.json --r-prefix 'dash'",
"private::host_js": "http-server ./dash_table -c-1 --silent",
"private::lint:ts": "tslint --project tsconfig.json --config tslint.json",
"private::lint:py": "flake8 --exclude=DataTable.py,__init__.py,_imports_.py dash_table && black --check --exclude dash_table .",
"private::lint:py": "flake8 --exclude=DataTable.py,__init__.py,_imports_.py dash_table tests && black --check --exclude dash_table .",
"private::wait_js": "wait-on http://localhost:8080",
"private::opentests": "cypress open",
"private::test.python": "python -m unittest tests/unit/format_test.py",
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/review_app/test_app_df_backend_paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ def section_title(title):

@app.callback(
Output(IDS["table"], "data"),
[Input(IDS["table"], "page_current"), Input(IDS["table"], "page_size"),],
[Input(IDS["table"], "page_current"), Input(IDS["table"], "page_size")],
)
def update_graph(page_current, page_size):
def update_data(page_current, page_size):
return df.iloc[
page_current * page_size : (page_current + 1) * page_size
].to_dict("rows")
Expand Down Expand Up @@ -243,7 +243,7 @@ def update_graph(page_current, page_size, sort_by):
Input(IDS["table-multi-sorting"], "sort_by"),
],
)
def update_graph(page_current, page_size, sort_by):
def update_multi_data(page_current, page_size, sort_by):
# print(sort_by)
if len(sort_by):
dff = df.sort_values(
Expand All @@ -267,7 +267,7 @@ def update_graph(page_current, page_size, sort_by):
Input(IDS["table-filtering"], "filter_query"),
],
)
def update_graph(page_current, page_size, filter_query):
def updat_filtering_data(page_current, page_size, filter_query):
# print(filter_query)
filtering_expressions = filter_query.split(" && ")
dff = df
Expand Down Expand Up @@ -298,7 +298,7 @@ def update_graph(page_current, page_size, filter_query):
Input(IDS["table-sorting-filtering"], "filter_query"),
],
)
def update_graph(page_current, page_size, sort_by, filter_query):
def update_sorting_filtering_data(page_current, page_size, sort_by, filter_query):
filtering_expressions = filter_query.split(" && ")
dff = df
for filter_query in filtering_expressions:
Expand Down Expand Up @@ -367,7 +367,7 @@ def update_table(page_current, page_size, sort_by, filter_query):
Output(IDS["table-paging-with-graph-container"], "children"),
[Input(IDS["table-paging-with-graph"], "data")],
)
def update_graph(rows):
def update_children(rows):
dff = pd.DataFrame(rows)
return html.Div(
[
Expand Down
5 changes: 0 additions & 5 deletions tests/integration/review_app/test_app_df_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
import dash_core_components as dcc
import dash_html_components as html
import dash_table
import time

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait

ID_PREFIX = "app_data_updating_graph"
IDS = {"table": ID_PREFIX, "container": "{}-container".format(ID_PREFIX)}
Expand Down
2 changes: 1 addition & 1 deletion tests/selenium/test_markdown_copy_paste.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_app():
id="table",
data=df[0:250],
columns=[
{"id": "Complaint ID", "name": "Complaint ID", "presentation": "markdown",},
{"id": "Complaint ID", "name": "Complaint ID", "presentation": "markdown"},
{"id": "Product", "name": "Product", "presentation": "markdown"},
{"id": "Sub-product", "name": "Sub-product"},
{"id": "Issue", "name": "Issue", "presentation": "markdown"},
Expand Down
9 changes: 1 addition & 8 deletions tests/selenium/test_pagination.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import dash
from dash.dependencies import Input, Output, State
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate

import dash_core_components as dcc
import dash_html_components as html
from dash_table import DataTable

import pytest
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains

import math
import pandas as pd
Expand Down Expand Up @@ -148,8 +145,6 @@ def test_tpag006_ops_input_invalid_with_enter(test, value, expected_value):

target = test.table("table")

text00 = target.cell(0, 0).get_text()

assert target.paging.current.get_value() == "1"

target.paging.current.click()
Expand All @@ -166,8 +161,6 @@ def test_tpag007_ops_input_invalid_with_unfocus(test, value, expected_value):

target = test.table("table")

text00 = target.cell(0, 0).get_text()

assert target.paging.current.get_value() == "1"

target.paging.current.click()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/format_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,16 @@ def test_invalid_trim_type(self):
def test_valid_decimal_delimiter(self):
Format().decimal_delimiter("x")

def test_valid_decimal_delimiter(self):
def test_valid_decimal_delimiter_multi_char(self):
self.assertRaises(ValueError, Format().decimal_delimiter, "xyz")

def test_invalid_decimal_delimiter(self):
self.assertRaises(TypeError, Format().decimal_delimiter, 7)

def test_valid_group_delimiator(self):
def test_valid_group_delimitator(self):
Format().group_delimiter("y")

def test_valid_group_delimiator(self):
def test_valid_group_delimitator_multi_char(self):
self.assertRaises(ValueError, Format().group_delimiter, "xyz")

def test_invalid_group_delimiter(self):
Expand Down

0 comments on commit a77b159

Please sign in to comment.