Skip to content

Commit

Permalink
Exclude visualization types from flake8 testing (#1925)
Browse files Browse the repository at this point in the history
* Moved visualization types to types subdirectory

* Updated flake8 test to ignore types subdirectory
  • Loading branch information
ajchili authored and k8s-ci-robot committed Aug 23, 2019
1 parent 5553566 commit 677ffe2
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ matrix:
language: python
python: "3.7"
install: pip install flake8
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
script: flake8 . --count --exclude=backend/src/apiserver/visualization/types/*.py --select=E9,F63,F7,F82 --show-source --statistics
2 changes: 1 addition & 1 deletion backend/src/apiserver/visualization/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def generate_notebook_from_arguments(
nb = new_notebook()
nb.cells.append(_exporter.create_cell_from_args(arguments))
nb.cells.append(new_code_cell('source = "{}"'.format(source)))
visualization_file = str(Path.cwd() / "{}.py".format(visualization_type))
visualization_file = str(Path.cwd() / "types/{}.py".format(visualization_type))
nb.cells.append(_exporter.create_cell_from_file(visualization_file))
return nb

Expand Down
2 changes: 1 addition & 1 deletion backend/src/apiserver/visualization/test_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_create_cell_from_args_with_multiple_args(self):

def test_create_cell_from_file(self):
self.maxDiff = None
cell = self.exporter.create_cell_from_file("test.py")
cell = self.exporter.create_cell_from_file("types/test.py")
self.assertMatchSnapshot(cell.source)

def test_generate_html_from_notebook(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# flake8: noqa TODO

import json
from pathlib import Path
from bokeh.layouts import row
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
#
# source

train_stats = tfdv.generate_statistics_from_csv(data_location=source) # noqa: F821
train_stats = tfdv.generate_statistics_from_csv(data_location=source)

tfdv.visualize_statistics(train_stats)
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

import tensorflow_model_analysis as tfma

# flake8: noqa TODO

if variables.get("slicing_column", False) == False {
tfma.view.render_slicing_metrics(source)
} else {
Expand Down

0 comments on commit 677ffe2

Please sign in to comment.