Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

YACHT-971: commons moved to src directory #28

Merged
merged 2 commits into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/backup/after_backup_action_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import webapp2

from src.big_query.big_query_table_metadata import BigQueryTableMetadata
from commons.decorators.retry import retry
from commons.exceptions import JsonNotParseableException, \
from src.commons.decorators.retry import retry
from src.commons.exceptions import JsonNotParseableException, \
WrongJsonFormatException
from commons.json_handler import JsonHandler
from src.commons.json_handler import JsonHandler
from src.backup.copy_job_async.copy_job_result import CopyJobResult
from src.backup.datastore.Backup import Backup
from src.backup.datastore.Table import Table
Expand Down
2 changes: 1 addition & 1 deletion src/backup/backup_id_creator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException


class BackupIdCreator(object):
Expand Down
2 changes: 1 addition & 1 deletion src/backup/copy_job_async/copy_job/copy_job_service.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from apiclient.errors import HttpError
from commons.decorators.retry import retry
from src.commons.decorators.retry import retry
from src.backup.copy_job_async.task_creator import TaskCreator
from src.backup.copy_job_async.result_check.result_check_request import ResultCheckRequest
from src.big_query.big_query import BigQuery
Expand Down
2 changes: 1 addition & 1 deletion src/backup/dataset_id_creator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException


class DatasetIdCreator(object):
Expand Down
2 changes: 1 addition & 1 deletion src/backup/datastore/Backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import datetime
from google.appengine.ext import ndb

from commons.decorators.retry import retry
from src.commons.decorators.retry import retry


class Backup(ndb.Model):
Expand Down
2 changes: 1 addition & 1 deletion src/backup/datastore/Table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import timedelta, date
from google.appengine.ext import ndb

from commons.decorators.retry import retry
from src.commons.decorators.retry import retry
from src.backup.datastore.Backup import Backup
from src.table_reference import TableReference

Expand Down
2 changes: 1 addition & 1 deletion src/backup/datastore/backup_finder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from datetime import datetime

from commons.exceptions import NotFoundException
from src.commons.exceptions import NotFoundException
from src.backup.datastore.Table import Table


Expand Down
2 changes: 1 addition & 1 deletion src/bbq_authenticated_handler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from commons.secured_handler import SecuredHandler
from src.commons.secured_handler import SecuredHandler
from src.configuration import configuration


Expand Down
6 changes: 3 additions & 3 deletions src/big_query/big_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from apiclient.errors import HttpError, Error
from oauth2client.client import GoogleCredentials

from commons.decorators.cached import cached
from commons.decorators.log_time import log_time, measure_time_and_log
from commons.decorators.retry import retry
from src.commons.decorators.cached import cached
from src.commons.decorators.log_time import log_time, measure_time_and_log
from src.commons.decorators.retry import retry
from src.big_query.big_query_table import BigQueryTable
from src.configuration import configuration
from src.table_reference import TableReference
Expand Down
2 changes: 1 addition & 1 deletion src/big_query/big_query_table_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from types import NoneType


from commons.decorators.cached import cached
from src.commons.decorators.cached import cached
from src.error_reporting import ErrorReporting
from src.table_reference import TableReference
from src.big_query.big_query import BigQuery
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion commons/json_handler.py → src/commons/json_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import webapp2
from googleapiclient.errors import HttpError

from commons.exceptions import ParameterValidationException, \
from src.commons.exceptions import ParameterValidationException, \
JsonNotParseableException, WrongJsonFormatException, NotFoundException


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from googleapiclient.errors import HttpError

from commons.decorators.retry import retry
from src.commons.decorators.retry import retry


class OAuth2Account(object):
Expand Down
2 changes: 1 addition & 1 deletion src/error_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from oauth2client.client import GoogleCredentials

from environment import Environment
from commons.decorators.retry import retry
from src.commons.decorators.retry import retry

from google.appengine.api.app_identity import app_identity

Expand Down
2 changes: 1 addition & 1 deletion src/google_cloud_storage_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import cloudstorage as gcs

from commons.decorators.retry import retry
from src.commons.decorators.retry import retry

my_default_retry_params = gcs.RetryParams(
initial_delay=0.2,
Expand Down
4 changes: 2 additions & 2 deletions src/restore/after_restore_action_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import webapp2
from google.appengine.ext import ndb

from commons.exceptions import JsonNotParseableException, \
from src.commons.exceptions import JsonNotParseableException, \
WrongJsonFormatException
from commons.json_handler import JsonHandler
from src.commons.json_handler import JsonHandler
from src.backup.copy_job_async.copy_job_result import CopyJobResult
from src.configuration import configuration
from src.restore.datastore.restore_item import RestoreItem
Expand Down
2 changes: 1 addition & 1 deletion src/restore/async_batch_restore_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from google.appengine.ext import ndb

from commons.decorators.log_time import log_time
from src.commons.decorators.log_time import log_time
from src.backup.copy_job_async.copy_job_service_async import CopyJobServiceAsync
from src.backup.copy_job_async.post_copy_action_request import \
PostCopyActionRequest
Expand Down
4 changes: 2 additions & 2 deletions src/restore/dataset/dataset_restore_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import webapp2

from commons.exceptions import ParameterValidationException
from commons.json_handler import JsonHandler
from src.commons.exceptions import ParameterValidationException
from src.commons.json_handler import JsonHandler
from src.bbq_authenticated_handler import BbqAuthenticatedHandler
from src.big_query import validators
from src.big_query.validators import WrongDatasetNameException
Expand Down
4 changes: 2 additions & 2 deletions src/restore/dataset/dataset_restore_items_generator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from commons.collections import paginated
from commons.decorators.log_time import log_time
from src.commons.collections import paginated
from src.commons.decorators.log_time import log_time
from src.backup.datastore.Table import Table
from src.restore.datastore.restore_item import RestoreItem
from src.restore.restoration_table_reference import RestoreTableReference
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException
from src.backup.datastore.Table import Table
from src.big_query.big_query import BigQuery
from src.configuration import configuration
Expand Down
2 changes: 1 addition & 1 deletion src/restore/list/backup_key_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from google.appengine.ext import ndb
from google.net.proto.ProtocolBuffer import ProtocolBufferDecodeError

from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException
from binascii import Error


Expand Down
4 changes: 2 additions & 2 deletions src/restore/list/backup_list_restore_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import webapp2

from commons.exceptions import ParameterValidationException, \
from src.commons.exceptions import ParameterValidationException, \
JsonNotParseableException
from commons.json_handler import JsonHandler
from src.commons.json_handler import JsonHandler
from src.bbq_authenticated_handler import BbqAuthenticatedHandler
from src.big_query import validators
from src.big_query.validators import WrongDatasetNameException
Expand Down
8 changes: 4 additions & 4 deletions src/restore/list/backup_list_restore_service.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from google.appengine.api.datastore_errors import BadRequestError, Error
from google.appengine.ext import ndb

from commons.collections import paginated
from commons.decorators.log_time import log_time
from commons.decorators.retry import retry
from commons.exceptions import ParameterValidationException
from src.commons.collections import paginated
from src.commons.decorators.log_time import log_time
from src.commons.decorators.retry import retry
from src.commons.exceptions import ParameterValidationException
from src.backup.datastore.Table import Table
from src.restore.async_batch_restore_service import AsyncBatchRestoreService
from src.restore.datastore.restoration_job import RestorationJob
Expand Down
2 changes: 1 addition & 1 deletion src/restore/status/restoration_job_status_handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import webapp2

from commons.json_handler import JsonHandler
from src.commons.json_handler import JsonHandler
from src.bbq_authenticated_handler import BbqAuthenticatedHandler
from src.configuration import configuration
from src.restore.status.restoration_job_status_service import \
Expand Down
4 changes: 2 additions & 2 deletions src/restore/status/restoration_job_status_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import logging
from collections import Counter

from commons import camel_case_converter
from commons.exceptions import NotFoundException
from src.commons import camel_case_converter
from src.commons.exceptions import NotFoundException
from src.environment import Environment
from src.configuration import configuration
from src.restore.datastore.restoration_job import RestorationJob
Expand Down
4 changes: 2 additions & 2 deletions src/restore/table/table_restore_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import webapp2

from commons.exceptions import ParameterValidationException
from commons.json_handler import JsonHandler
from src.commons.exceptions import ParameterValidationException
from src.commons.json_handler import JsonHandler
from src.bbq_authenticated_handler import BbqAuthenticatedHandler
from src.big_query import validators
from src.configuration import configuration
Expand Down
2 changes: 1 addition & 1 deletion src/restore/test/table_randomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime, timedelta

from src.big_query.big_query_table_metadata import BigQueryTableMetadata
from commons.decorators.retry import retry
from src.commons.decorators.retry import retry
from src.big_query.big_query import BigQuery, RandomizationError
from src.table_reference import TableReference

Expand Down
4 changes: 2 additions & 2 deletions src/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
UnknownQueueError, Task
from google.appengine.runtime.apiproxy_errors import DeadlineExceededError

from commons.decorators.retry import retry
from src.commons.decorators.retry import retry
from error_reporting import ErrorReporting
from src import request_correlation_id
from commons.collections import paginated
from src.commons.collections import paginated


class Tasks(object):
Expand Down
2 changes: 1 addition & 1 deletion tests/backup/copy_job_async/test_task_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from google.appengine.ext import testbed
from mock import patch

from commons.test_utils import utils
from src.commons.test_utils import utils
from src.backup.copy_job_async.copy_job.copy_job_request import CopyJobRequest
from src.backup.copy_job_async.copy_job.copy_job_task_name import \
CopyJobTaskName
Expand Down
2 changes: 1 addition & 1 deletion tests/backup/test_after_backup_action_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import webtest
from google.appengine.ext import testbed
from apiclient.http import HttpMockSequence
from commons.test_utils import utils
from src.commons.test_utils import utils
from src.backup import after_backup_action_handler
from src.big_query.big_query_table import BigQueryTable

Expand Down
2 changes: 1 addition & 1 deletion tests/backup/test_backup_id_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime

from src.backup.backup_id_creator import BackupIdCreator
from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException


class TestBackupIdCreator(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/backup/test_backup_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from google.appengine.ext import testbed
from mock import patch, Mock, mock, call

from commons.test_utils import utils
from src.commons.test_utils import utils
from mock.mock import PropertyMock
from src import request_correlation_id
from src.backup.backup_scheduler import BackupScheduler
Expand Down
2 changes: 1 addition & 1 deletion tests/backup/test_dataset_id_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime

from src.backup.dataset_id_creator import DatasetIdCreator
from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException


class TestDatasetIdCreator(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/backup/test_organisation_retention_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from google.appengine.ext import testbed

import webtest
from commons.test_utils import utils
from src.commons.test_utils import utils
from mock import patch
from src.backup.datastore.Table import Table
from src.retention.organization_retention_handler import \
Expand Down
2 changes: 1 addition & 1 deletion tests/backup/test_task_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from google.appengine.ext import testbed
from mock import patch

from commons.test_utils import utils
from src.commons.test_utils import utils
from src import request_correlation_id
from src.backup.task_creator import TaskCreator

Expand Down
2 changes: 1 addition & 1 deletion tests/restore/dataset/test_dataset_restore_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import uuid

from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException
from src.restore.dataset.dataset_restore_service import DatasetRestoreService
from src.restore.status.restoration_job_status_service import \
RestorationJobStatusService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from google.appengine.ext import testbed
from mock import patch

from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException
from src.restore.dataset.dataset_restore_parameters_validator import \
DatasetRestoreParametersValidator
from tests.utils import table_entities_creator
Expand Down
2 changes: 1 addition & 1 deletion tests/restore/list/test_backup_key_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from google.appengine.ext import ndb

from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException
from src.restore.list.backup_key_parser import BackupKeyParser


Expand Down
2 changes: 1 addition & 1 deletion tests/restore/list/test_backup_list_restore_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from google.appengine.ext import testbed, ndb
from mock import patch, PropertyMock

from commons.exceptions import ParameterValidationException
from src.commons.exceptions import ParameterValidationException
from src.backup.datastore.Backup import Backup
from src.backup.datastore.Table import Table
from src.configuration import Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from google.appengine.ext import testbed, ndb
from mock import patch, PropertyMock

from commons.exceptions import NotFoundException
from src.commons.exceptions import NotFoundException
from src.environment import Environment
from src.configuration import Configuration
from src.restore.datastore.restoration_job import RestorationJob
Expand Down
2 changes: 1 addition & 1 deletion tests/restore/table/test_backup_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from google.appengine.ext import testbed, ndb

from commons.exceptions import NotFoundException
from src.commons.exceptions import NotFoundException
from src.backup.datastore.Table import Table
from src.backup.datastore.backup_finder import BackupFinder
from src.table_reference import TableReference
Expand Down
2 changes: 1 addition & 1 deletion tests/restore/table/test_table_restore_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from datetime import datetime

from commons.exceptions import NotFoundException
from src.commons.exceptions import NotFoundException
from src.restore.table import table_restore_handler
from src.restore.table.table_restore_service import TableRestoreService
from src.table_reference import TableReference
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cached_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from google.appengine.api import memcache
from google.appengine.ext import testbed

from commons.decorators.cached import cached
from src.commons.decorators.cached import cached
from mock import patch, call

RETURNED_VALUE = 'importantString'
Expand Down
Loading