Skip to content

Commit

Permalink
Get PK from metadata map
Browse files Browse the repository at this point in the history
Co-authored-by: dsprayberry <[email protected]>
  • Loading branch information
bryantgray and dsprayberry committed Oct 24, 2023
1 parent c75c5ec commit 364bd72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tap_github/discover.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import singer
from singer import metadata
from singer.catalog import Catalog, CatalogEntry, Schema
from tap_github.schema import get_schemas

Expand All @@ -24,13 +25,12 @@ def discover(client):
LOGGER.error('type schema_dict: %s', type(schema_dict))
raise err

root_mdata = [x for x in mdata if x['breadcrumb'] == ()]
key_properties = root_mdata[0]['metadata'].get('table-key-properties')
key_properties = metadata.to_map(mdata).get((), {}).get('table-key-properties')

catalog.streams.append(CatalogEntry(
stream=stream_name,
tap_stream_id=stream_name,
key_properties= key_properties,
key_properties=key_properties,
schema=schema,
metadata=mdata
))
Expand Down

0 comments on commit 364bd72

Please sign in to comment.