Skip to content

Commit

Permalink
remove singer imports (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
JYOTHINARAYANSETTY authored Mar 22, 2023
1 parent 926b5d3 commit e863a4d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions tests/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import psycopg2
from psycopg2.extensions import quote_ident

# steal top_map method from singer-python so we can remove singer imports from tests
def to_map(raw_metadata):
return {tuple(md['breadcrumb']): md['metadata'] for md in raw_metadata}

def ensure_environment_variables_set():
missing_envs = [x for x in [os.getenv('TAP_POSTGRES_HOST'),
os.getenv('TAP_POSTGRES_USER'),
Expand Down
3 changes: 1 addition & 2 deletions tests/test_postgres_views_full_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import psycopg2.extras
from psycopg2.extensions import quote_ident
from singer import metadata
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -184,7 +183,7 @@ def test_run(self):
('properties', 'age'): {'inclusion': 'available', 'sql-datatype': 'integer', 'selected-by-default': True},
('properties', 'size'): {'inclusion': 'available', 'sql-datatype': 'character varying', 'selected-by-default': True},
('properties', 'id'): {'inclusion': 'available', 'sql-datatype': 'integer', 'selected-by-default': True}},
metadata.to_map(md))
db_utils.to_map(md))


# 'ID' selected as view-key-properties
Expand Down
3 changes: 1 addition & 2 deletions tests/test_postgres_views_incremental_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import psycopg2.extras
from psycopg2.extensions import quote_ident
from singer import metadata
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -190,7 +189,7 @@ def test_run(self):
('properties', 'size'): {'inclusion': 'available', 'sql-datatype': 'character varying', 'selected-by-default': True},
('properties', 'id'): {'inclusion': 'available', 'sql-datatype': 'integer', 'selected-by-default': True},
('properties', 'updated_at'): {'selected-by-default': True, 'inclusion': 'available', 'sql-datatype': 'timestamp with time zone'}},
metadata.to_map(md))
db_utils.to_map(md))


# 'ID' selected as view-key-properties, updated_at is replication_key
Expand Down
3 changes: 1 addition & 2 deletions tests/test_postgres_views_logical_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import psycopg2.extras
from psycopg2.extensions import quote_ident
from singer import metadata
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -176,7 +175,7 @@ def test_run(self):
('properties', 'age'): {'inclusion': 'available', 'sql-datatype': 'integer', 'selected-by-default': True},
('properties', 'size'): {'inclusion': 'available', 'sql-datatype': 'character varying', 'selected-by-default': True},
('properties', 'id'): {'inclusion': 'available', 'sql-datatype': 'integer', 'selected-by-default': True}},
metadata.to_map(md))
db_utils.to_map(md))


# 'ID' selected as view-key-properties
Expand Down

0 comments on commit e863a4d

Please sign in to comment.