From b7dae0c9249bf5c014dfade6b14f1ae0538d88ec Mon Sep 17 00:00:00 2001 From: Brian Wilson Date: Thu, 18 Apr 2019 12:38:12 -0400 Subject: [PATCH] Update snowflake and ga includes for isort. Also update Makefile so that venv gets properly populated before calling isort within that venv. --- Makefile | 7 +++++-- edx/analytics/tasks/common/snowflake_load.py | 4 ++-- edx/analytics/tasks/warehouse/load_ga_permissions.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7b01daed9e..7f01d84cf6 100644 --- a/Makefile +++ b/Makefile @@ -75,12 +75,15 @@ test-acceptance-local: test-acceptance-local-all: REMOTE_TASK=$(shell which remote-task) LUIGI_CONFIG_PATH='config/test.cfg' ACCEPTANCE_TEST_CONFIG="/var/tmp/acceptance.json" python -m coverage run --rcfile=./.coveragerc -m nose --nocapture --with-xunit -A acceptance -v -quality-docker-local: +quality-local: bash -c 'source ${ANALYTICS_PIPELINE_VENV}/analytics_pipeline/bin/activate && isort --check-only --recursive edx/' pycodestyle edx +quality-docker-local: + docker run --rm -u root -v `(pwd)`:/edx/app/analytics_pipeline/analytics_pipeline -it edxops/analytics_pipeline:latest make develop-local quality-local + quality-docker: - docker run --rm -u root -v `(pwd)`:/edx/app/analytics_pipeline/analytics_pipeline -it edxops/analytics_pipeline:latest make quality-docker-local + docker run --rm -u root -v `(pwd)`:/edx/app/analytics_pipeline/analytics_pipeline -it edxops/analytics_pipeline:latest make reset-virtualenv test-requirements develop-local quality-local coverage-docker: docker run --rm -u root -v `(pwd)`:/edx/app/analytics_pipeline/analytics_pipeline -it edxops/analytics_pipeline:latest coverage xml diff --git a/edx/analytics/tasks/common/snowflake_load.py b/edx/analytics/tasks/common/snowflake_load.py index 671eec97e8..1cf1c14d3a 100644 --- a/edx/analytics/tasks/common/snowflake_load.py +++ b/edx/analytics/tasks/common/snowflake_load.py @@ -5,13 +5,13 @@ import logging import luigi +import snowflake.connector from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization +from snowflake.connector import ProgrammingError -import snowflake.connector from edx.analytics.tasks.util.overwrite import OverwriteOutputMixin from edx.analytics.tasks.util.url import ExternalURL -from snowflake.connector import ProgrammingError log = logging.getLogger(__name__) diff --git a/edx/analytics/tasks/warehouse/load_ga_permissions.py b/edx/analytics/tasks/warehouse/load_ga_permissions.py index 58b10384de..b584d6125d 100644 --- a/edx/analytics/tasks/warehouse/load_ga_permissions.py +++ b/edx/analytics/tasks/warehouse/load_ga_permissions.py @@ -7,9 +7,9 @@ import logging import luigi +from apiclient.discovery import build from google.oauth2 import service_account -from apiclient.discovery import build from edx.analytics.tasks.common.vertica_load import VerticaCopyTask, VerticaCopyTaskMixin from edx.analytics.tasks.util.hive import WarehouseMixin from edx.analytics.tasks.util.overwrite import OverwriteOutputMixin