-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90e80d1
commit 17b2912
Showing
14 changed files
with
7,146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This folder is uploaded to a GCS bucket. |
1,000 changes: 1,000 additions & 0 deletions
1,000
...-json-remote/data/inventory/year=2022/month=04/day=20/hour=00/inventory+0+0001327496.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,000 changes: 1,000 additions & 0 deletions
1,000
...-json-remote/data/inventory/year=2022/month=04/day=20/hour=00/inventory+0+0001328496.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,000 changes: 1,000 additions & 0 deletions
1,000
...-json-remote/data/inventory/year=2022/month=04/day=20/hour=00/inventory+0+0001329496.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,000 changes: 1,000 additions & 0 deletions
1,000
...-json-remote/data/inventory/year=2022/month=04/day=20/hour=00/inventory+0+0001330496.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,000 changes: 1,000 additions & 0 deletions
1,000
...-json-remote/data/inventory/year=2022/month=05/day=04/hour=00/inventory+0+0002657902.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,000 changes: 1,000 additions & 0 deletions
1,000
...-json-remote/data/inventory/year=2022/month=05/day=04/hour=00/inventory+0+0002658902.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,000 changes: 1,000 additions & 0 deletions
1,000
...-json-remote/data/inventory/year=2022/month=05/day=04/hour=00/inventory+0+0002659902.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
dataContractSpecification: 0.9.2 | ||
id: inventory-events | ||
info: | ||
title: Inventory Events | ||
version: 0.0.1 | ||
owner: my-domain-team | ||
contact: | ||
email: jochen.christ@innoq.com | ||
servers: | ||
gcs-url: | ||
type: gcs | ||
location: gs://datacontract-test-inventory/inventory/*/*/*/*/*.json | ||
delimiter: new_line | ||
format: json | ||
s3-style: | ||
type: s3 | ||
endpointUrl: https://storage.googleapis.com | ||
location: s3://datacontract-test-inventory/inventory/*/*/*/*/*.json | ||
delimiter: new_line | ||
format: json | ||
models: | ||
inventory: | ||
type: table | ||
fields: | ||
updated_at: | ||
type: string | ||
available: | ||
type: numeric | ||
location: | ||
type: string | ||
sku: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import os | ||
|
||
import pytest | ||
from dotenv import load_dotenv | ||
|
||
from datacontract.data_contract import DataContract | ||
|
||
datacontract = "fixtures/gcs-json-remote/datacontract.yaml" | ||
load_dotenv(override=True) | ||
|
||
|
||
@pytest.mark.skipif( | ||
os.environ.get("DATACONTRACT_GCS_KEY_ID") is None or os.environ.get("DATACONTRACT_GCS_SECRET") is None, | ||
reason="Requires DATACONTRACT_GCS_KEY_ID, and DATACONTRACT_GCS_SECRET to be set", | ||
) | ||
def test_test_gcs_json_remote_gcs_url(): | ||
""" | ||
server.type "gcs" and gs:// locations work with DuckDB, but are not yet supported for json schema testing | ||
""" | ||
data_contract = DataContract( | ||
data_contract_file=datacontract, | ||
server="gcs-url", | ||
) | ||
|
||
run = data_contract.test() | ||
|
||
print(run) | ||
assert run.result == "passed" | ||
|
||
|
||
@pytest.mark.skipif( | ||
os.environ.get("DATACONTRACT_GCS_KEY_ID") is None or os.environ.get("DATACONTRACT_GCS_SECRET") is None, | ||
reason="Requires DATACONTRACT_GCS_KEY_ID, and DATACONTRACT_GCS_SECRET to be set", | ||
) | ||
def test_test_gcs_json_remote_s3_style(monkeypatch): | ||
monkeypatch.setenv("DATACONTRACT_S3_ACCESS_KEY_ID", os.environ.get("DATACONTRACT_GCS_KEY_ID")) | ||
monkeypatch.setenv("DATACONTRACT_S3_SECRET_ACCESS_KEY", os.environ.get("DATACONTRACT_GCS_SECRET")) | ||
|
||
data_contract = DataContract( | ||
data_contract_file=datacontract, | ||
server="s3-style", | ||
) | ||
|
||
run = data_contract.test() | ||
|
||
print(run) | ||
assert run.result == "passed" | ||
assert all(check.result == "passed" for check in run.checks) |