Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema config and CI #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Target MSSQL tests

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: {}

jobs:
linting:
runs-on: ubuntu-latest
strategy:
matrix:
# Only lint using the primary version used for dev
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python '${{ matrix.python-version }}'
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python-version }}'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.1.14
- name: Install dependencies
run: |
poetry install
- name: Run lint command from tox.ini
run: |
poetry run tox -e lint
pytest:
runs-on: ubuntu-latest
services:
mssql:
image: gvenzl/oracle-xe
env:
ORACLE_PASSWORD: P@55w0rd
ports:
- 1521:1521
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python '${{ matrix.python-version }}'
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python-version }}'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.1.11
- name: Install dependencies
run: |
poetry install
- name: Test with pytest
run: |
poetry run pytest --capture=no
1 change: 1 addition & 0 deletions meltano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins:
- name: host
- name: port
- name: database
- name: schema
- name: start_date
value: '2010-01-01T00:00:00Z'
- name: freeze_schema
1 change: 1 addition & 0 deletions target_oracle/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_sqlalchemy_url(self, config: dict) -> str:
host=config["host"],
port=config["port"],
database=config["database"],
schema = config["schema"] or config["user"]
)
return connection_url

Expand Down
6 changes: 6 additions & 0 deletions target_oracle/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class TargetOracle(SQLTarget):
th.BooleanType,
description="Do not alter types of existing columns",
default=False
),
th.Property(
"schema",
th.StringType,
description="Target database schema for the data",
default=None
)
).to_dict()

Expand Down
2 changes: 1 addition & 1 deletion target_oracle/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def oracle_config():
}

oracle_config_dict = {
"schema": "SYSTEM",
"user": "SYSTEM",
"password": "P@55w0rd",
"host": "localhost",
Expand Down Expand Up @@ -72,6 +71,7 @@ def get_engine():
host=config["host"],
port=config["port"],
database=config["database"],
schema = config["schema"] or config["user"]
)

engine = create_engine(connection_url)
Expand Down
Loading