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

Commit

Permalink
Merge pull request #8 from transferwise/AP-473
Browse files Browse the repository at this point in the history
Switch to pipelinewise-singer-python and name loggers
  • Loading branch information
Samira-El authored Feb 10, 2020
2 parents 5519350 + ffa0840 commit bbfff61
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 16 deletions.
25 changes: 25 additions & 0 deletions sample_logging.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[loggers]
keys=root

[handlers]
keys=stderr

[formatters]
keys=child

[logger_root]
level=INFO
handlers=stderr
formatter=child
propagate=0

[handler_stderr]
level=INFO
class=StreamHandler
formatter=child
args=(sys.stderr,)

[formatter_child]
class=logging.Formatter
format=time=%(asctime)s name=%(name)s level=%(levelname)s message=%(message)s
datefmt=%Y-%m-%d %H:%M:%S
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
py_modules=['tap_snowflake'],
install_requires=[
'singer-python==5.9.0',
'pipelinewise-singer-python==1.*',
'snowflake-connector-python==2.0.4',
'backoff==1.8.0',
'pendulum==1.2.0',
Expand Down
15 changes: 6 additions & 9 deletions tap_snowflake/__init__.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
#!/usr/bin/env python3
# pylint: disable=missing-docstring,not-an-iterable,too-many-locals,too-many-arguments,too-many-branches,invalid-name,duplicate-code,too-many-statements

import datetime
import collections
import itertools
from itertools import dropwhile
import copy

import itertools
import logging

import singer
import singer.metrics as metrics
import singer.schema

from singer import bookmarks
from singer import metadata
from singer import utils
from singer.schema import Schema
from singer.catalog import Catalog, CatalogEntry
from singer.schema import Schema

import tap_snowflake.sync_strategies.common as common
import tap_snowflake.sync_strategies.full_table as full_table
import tap_snowflake.sync_strategies.incremental as incremental

from tap_snowflake.connection import SnowflakeConnection

LOGGER = singer.get_logger('tap_snowflake')

LOGGER = singer.get_logger()
# Tone down snowflake connector logs noise
logging.getLogger('snowflake.connector').setLevel(logging.WARNING)

Column = collections.namedtuple('Column', [
"table_catalog",
Expand Down
2 changes: 1 addition & 1 deletion tap_snowflake/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import singer
import snowflake.connector

LOGGER = singer.get_logger()
LOGGER = singer.get_logger('tap_snowflake')


def retry_pattern():
Expand Down
2 changes: 1 addition & 1 deletion tap_snowflake/sync_strategies/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from singer import metadata
from singer import utils

LOGGER = singer.get_logger()
LOGGER = singer.get_logger('tap_snowflake')

def escape(string):
if '"' in string:
Expand Down
2 changes: 1 addition & 1 deletion tap_snowflake/sync_strategies/full_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import tap_snowflake.sync_strategies.common as common
from tap_snowflake.connection import SnowflakeConnection

LOGGER = singer.get_logger()
LOGGER = singer.get_logger('tap_snowflake')

BOOKMARK_KEYS = {'last_pk_fetched', 'max_pk_values', 'version', 'initial_full_table_complete'}

Expand Down
2 changes: 1 addition & 1 deletion tap_snowflake/sync_strategies/incremental.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from tap_snowflake.connection import SnowflakeConnection
import tap_snowflake.sync_strategies.common as common

LOGGER = singer.get_logger()
LOGGER = singer.get_logger('tap_snowflake')

BOOKMARK_KEYS = {'replication_key', 'replication_key_value', 'version'}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_tap_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
except ImportError:
import utils as test_utils

LOGGER = singer.get_logger()
LOGGER = singer.get_logger('tap_snowflake_tests')

SCHEMA_NAME='tap_snowflake_test'

Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import singer
import snowflake.connector

import tap_snowflake
from tap_snowflake.connection import SnowflakeConnection
Expand Down

0 comments on commit bbfff61

Please sign in to comment.