i'm trying to extract data from marketo using the ...
# troubleshooting
h
i'm trying to extract data from marketo using the default tap-marketo. I can't figure out how to select only a subset of fields for the export. my meltano.yml looks like this
Copy code
plugins:
  extractors:
  - name: tap-marketo
    variant: meltano
    pip_url: git+<https://gitlab.com/meltano/tap-marketo.git>
    config:
      endpoint: $MKTO_ENDPOINT
      identity: $MKTO_IDENTITY
      client_id: $MKTO_CLIENT_ID
      start_date: 2015-01-01
      client_secret: $MKTO_CLIENT_SECRET
    select:
    - leads.id
    - leads.createdAt
    - leads.updatedAt
    - leads.userUUID
  loaders:
  - name: target-postgres
    variant: datamill-co
    pip_url: singer-target-postgres
    config:
      postgres_host: localhost
      postgres_password: meltano_local
      postgres_username: meltano_local
      postgres_database: meltano_local
      postgres_port: 5432
and i tried running the cli command
meltano elt tap-marketo target-postgres
but it seems to be fetching everything, which i would like to avoid.
any help is appreciated 🙂
d
@haleemur_ali Unfortunately, it doesn’t look like tap-marketo implements stream selection currently, so this functionality would first need to be implemented in https://gitlab.com/meltano/tap-marketo or https://github.com/singer-io/tap-marketo
h
thanks @douwe_maan, I'm more than happy to contribute this back to the community. from a very quick glance, it seems that the singer-io tap is more actively maintained.
Do you know of any helpful guides for implementing stream selection
d
I’m more than happy to contribute this back to the community.
Awesome!
from a very quick glance, it seems that the singer-io tap is more actively maintained.
I agree
On second look, it appears that https://github.com/singer-io/tap-marketo/blob/master/tap_marketo/__init__.py#L76 actually implements selection already, since it lists
args.catalog
, and it’s checked here: https://github.com/singer-io/tap-marketo/blob/master/tap_marketo/sync.py#L467 !
So I suggest adding the singer-io variant as a custom plugin to your Meltano project and trying that instead of the meltano variant you’re currently using: https://hub.meltano.com/taps/marketo--singer-io#usage-with-meltano
When it asks for capabilities, list
state
,
catalog
, and
discover
h
thanks Douwe, so after a little pain, i got it working. will submit a patch to the signer-io/tap-marketo repository. I'm using meltano v1.78.0 / python 3.8.10 and the latest tap-marketo from singer-io, the catalog instance is not subscriptable, and in a couple of spots the tap tries to access the catalog keys as if it were a dictionary e.g. https://github.com/singer-io/tap-marketo/blob/master/tap_marketo/__init__.py#L36
Copy code
for stream in catalog["streams"]:
the Catalog class has a method
to_dict
https://github.com/singer-io/singer-python/blob/master/singer/catalog.py#L52 and converting to a dict prior to accessing a key resolves the bug for me.