Skip to content
This repository was archived by the owner on Mar 13, 2020. It is now read-only.

Commit bc9d228

Browse files
authored
Merge pull request #22 from PageUpPeopleOrg/rdl-module-test
Change RDL to proper module structure
2 parents 4a3d633 + c0df9a7 commit bc9d228

39 files changed

+46
-47
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.vscode/
44

55
# config files
6-
modules/tests/config/connection.json
6+
rdl/tests/config/connection.json
77

88
# Byte-compiled / optimized / DLL files
99
__pycache__/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ A utility for taking data from MS-SQL and loading it into PostgreSQL
66

77
## Usage
88

9-
`py rdl.py --help`
9+
`py -m rdl --help`
1010

1111
```text
12-
usage: rdl.py process [-h] [-f [FORCE_FULL_REFRESH_MODELS]] [-l [LOG_LEVEL]]
12+
usage: py -m rdl process [-h] [-f [FORCE_FULL_REFRESH_MODELS]] [-l [LOG_LEVEL]]
1313
source-connection-string destination-connection-string
1414
configuration-folder
1515
@@ -39,7 +39,7 @@ optional arguments:
3939
Set the logging output level. ['CRITICAL', 'ERROR',
4040
'WARNING', 'INFO', 'DEBUG']
4141
42-
usage: rdl.py audit [-h] [-l [LOG_LEVEL]]
42+
usage: py -m rdl audit [-h] [-l [LOG_LEVEL]]
4343
destination-connection-string model-type timestamp
4444
4545
positional arguments:
@@ -134,7 +134,7 @@ _See [Postgres docs](https://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf
134134

135135
_Setup:_
136136

137-
Create a new SQL Server Login/User using the script below. Make sure you update it with your desired password and if you update the username/login, please ensure the changes are reflected in: `modules/tests/config/connection.json`, which can be created using `modules/tests/config/connection.json.template`.
137+
Create a new SQL Server Login/User using the script below. Make sure you update it with your desired password and if you update the username/login, please ensure the changes are reflected in: `rdl/tests/config/connection.json`, which can be created using `rdl/tests/config/connection.json.template`.
138138

139139
```sql
140140
USE master;

modules/tests/__init__.py

Whitespace-only changes.

rdl.py

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import csv
33

44
from io import StringIO
5-
from modules.column_transformers.StringTransformers import ToUpper
6-
from modules.shared import Constants
5+
from rdl.column_transformers.StringTransformers import ToUpper
6+
from rdl.shared import Constants
77

88

99
class BatchDataLoader(object):
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from pathlib import Path
66
from json import JSONDecodeError
77

8-
from modules.BatchDataLoader import BatchDataLoader
9-
from modules.DestinationTableManager import DestinationTableManager
10-
from modules.data_load_tracking.DataLoadTracker import DataLoadTracker
11-
from modules.BatchKeyTracker import BatchKeyTracker
12-
from modules.shared import Constants
8+
from rdl.BatchDataLoader import BatchDataLoader
9+
from rdl.DestinationTableManager import DestinationTableManager
10+
from rdl.data_load_tracking.DataLoadTracker import DataLoadTracker
11+
from rdl.BatchKeyTracker import BatchKeyTracker
12+
from rdl.shared import Constants
1313

1414

1515
class DataLoadManager(object):
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import io
22
import os
33
import logging
4-
from modules.ColumnTypeResolver import ColumnTypeResolver
4+
from rdl.ColumnTypeResolver import ColumnTypeResolver
55

66
from sqlalchemy import MetaData, DateTime, Boolean, BigInteger
77
from sqlalchemy.schema import Column, Table
88
from sqlalchemy.sql import func
9-
from modules.shared import Constants
9+
from rdl.shared import Constants
1010

1111

1212
class DestinationTableManager(object):
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import argparse
33
from datetime import datetime
44
from sqlalchemy import create_engine
5-
from modules.DataLoadManager import DataLoadManager
6-
from modules.shared import Constants
7-
from modules.data_load_tracking.DataLoadTrackerRepository import DataLoadTrackerRepository
8-
from modules.data_sources.DataSourceFactory import DataSourceFactory
5+
from rdl.DataLoadManager import DataLoadManager
6+
from rdl.shared import Constants
7+
from rdl.data_load_tracking.DataLoadTrackerRepository import DataLoadTrackerRepository
8+
from rdl.data_sources.DataSourceFactory import DataSourceFactory
99
from sqlalchemy.orm import sessionmaker
1010

1111
_LOG_LEVEL_STRINGS = ['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG']

0 commit comments

Comments
 (0)