Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erros in README.md: wrong tap arguments and missing information #6

Open
PoulpiFr opened this issue May 1, 2020 · 0 comments
Open

Comments

@PoulpiFr
Copy link
Contributor

PoulpiFr commented May 1, 2020

Wrong argument in snippet

In the README.md, it is stated:

Then to run the extract:

› tap-frontapp --config config.json --catalog catalog.json --state state.json

While the catalog argument is not parsed by the tap. Instead, the properties argument is used: https://github.com/singer-io/tap-frontapp/blob/master/tap_frontapp/__init__.py#L84

if args.properties else discover()

Missing information

In order for the tap to run, we need to add an entry in the streams record of the catalog.

See:

https://github.com/singer-io/tap-frontapp/blob/master/tap_frontapp/context.py

    def catalog(self, catalog):
        self._catalog = catalog
        self.selected_stream_ids = set()
        for stream in catalog.streams:
            mdata = metadata.to_map(stream.metadata)
            root_metadata = mdata.get(())
            if root_metadata and root_metadata.get('selected') is True:
                self.selected_stream_ids.add(stream.tap_stream_id)

https://github.com/singer-io/tap-frontapp/blob/master/tap_frontapp/streams.py

def sync_selected_streams(atx):
    selected_streams = atx.selected_stream_ids

    # last_synced_stream = atx.state.get('last_synced_stream')

    if IDS.TEAM_TABLE in selected_streams:
        sync_metrics(atx, 'team_table')

in order to have the streams in the selected_stream_ids, we need to add a entry in the catalog.json with an empty breadcrumbs array to be set in the ()value of the map generated from the catalog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant