Created
July 28, 2020 12:46
-
-
Save ntakouris/5c877377f11d02d2b1b0eaf9f4f3876f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
metadata_connection_config = metadata.sqlite_metadata_connection_config( | |
os.path.join(bucket_uri, 'schema_generation', 'metadata.db')) # defaults to this | |
with metadata.Metadata(metadata_connection_config) as store: | |
schema_artifacts = store.get_artifacts_by_type( | |
standard_artifacts.Schema.TYPE_NAME) | |
latest_schema_uri = max(schema_artifacts, key=attrgetter( | |
'last_update_time_since_epoch')).uri | |
latest_schema_uri = os.path.join(latest_schema_uri, 'schema.pbtxt') | |
print(f'Schema at {latest_schema_uri}:') | |
with open(latest_schema_uri, 'r') as f: | |
print(f.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment