forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): fix example data contract yaml + update airflow codecov (da…
- Loading branch information
Showing
4 changed files
with
39 additions
and
20 deletions.
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
11 changes: 11 additions & 0 deletions
11
metadata-ingestion-modules/airflow-plugin/tests/conftest.py
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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
import pathlib | ||
import site | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--update-golden-files", | ||
action="store_true", | ||
default=False, | ||
) | ||
|
||
|
||
# See https://coverage.readthedocs.io/en/latest/subprocess.html#configuring-python-for-sub-process-measurement | ||
coverage_startup_code = "import coverage; coverage.process_startup()" | ||
site_packages_dir = pathlib.Path(site.getsitepackages()[0]) | ||
pth_file_path = site_packages_dir / "datahub_coverage_startup.pth" | ||
pth_file_path.write_text(coverage_startup_code) |
42 changes: 25 additions & 17 deletions
42
metadata-ingestion/examples/data_contract/pet_of_the_week.dhub.dc.yaml
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 |
---|---|---|
@@ -1,21 +1,29 @@ | ||
# id: pet_details_dc # Optional: This is the unique identifier for the data contract | ||
display_name: Data Contract for SampleHiveDataset | ||
version: 1 # datahub yaml format version | ||
|
||
# Note: this data contract yaml format is still in development, and will likely | ||
# change in backwards-incompatible ways in the future. | ||
|
||
entity: urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD) | ||
freshness: | ||
time: 0700 | ||
granularity: DAILY | ||
type: cron | ||
cron: 0 7 * * * # 7am daily | ||
timezone: America/Los_Angeles | ||
schema: | ||
properties: | ||
field_foo: | ||
type: string | ||
native_type: VARCHAR(100) | ||
field_bar: | ||
type: boolean | ||
required: | ||
- field_bar | ||
type: json-schema | ||
json-schema: | ||
properties: | ||
field_foo: | ||
type: string | ||
native_type: VARCHAR(100) | ||
field_bar: | ||
type: boolean | ||
required: | ||
- field_bar | ||
data_quality: | ||
- type: column_range | ||
config: | ||
column: field_foo | ||
min: 0 | ||
max: 100 | ||
- type: unique | ||
column: field_foo | ||
- type: custom_sql | ||
sql: SELECT COUNT(*) FROM SampleHiveDataset | ||
operator: | ||
type: greater_than | ||
value: 100 |