-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from AutoIDM/snowflake-issues
Added a ref Resolver
- Loading branch information
Showing
13 changed files
with
327 additions
and
157 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
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,7 @@ | ||
To run the schema parser | ||
1. python -m venv .venv | ||
1. source .venv/bin/activate | ||
1. pip install -r requirements.txt | ||
1. python resolver.py | ||
|
||
Data will land in ./parsed_schemas |
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,11 @@ | ||
attrs==21.4.0 | ||
backoff==1.11.1 | ||
ciso8601==2.2.0 | ||
jsonschema==3.2.0 | ||
orjson==3.6.1 | ||
pipelinewise-singer-python==2.0.1 | ||
pkg_resources==0.0.0 | ||
pyrsistent==0.18.0 | ||
python-dateutil==2.8.2 | ||
pytz==2021.3 | ||
six==1.16.0 |
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,18 @@ | ||
import singer | ||
import json | ||
import os | ||
|
||
#list of files to transform | ||
file_names = [] | ||
for file in os.listdir("."): | ||
if file.endswith(".json"): | ||
file_names.append(file) | ||
|
||
for schema_file in file_names: | ||
with open(schema_file) as f: | ||
old_schema = json.load(f) | ||
new_schema = singer.resolve_schema_references(old_schema) | ||
with open(f"./parsed_schemas/{schema_file}", "w") as w: | ||
w.write(json.dumps(new_schema, indent=4)) | ||
|
||
|
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
Oops, something went wrong.