singer-io / tap-marketo

GNU Affero General Public License v3.0
9 stars 17 forks source link

TypeError: 'Catalog' object is not subscriptable #47

Closed faumel closed 5 years ago

faumel commented 5 years ago

CentOS release 6.5 Python 3.5.2 installed tap-marketo using "pip install tap-marketo" which installed v2.1.1

$ pip list Package Version


backoff 1.3.2
certifi 2019.3.9 chardet 3.0.4
freezegun 0.3.11
idna 2.7
jsonschema 2.6.0
pendulum 1.2.0
pip 19.1.1
python-dateutil 2.8.0
pytz 2019.1
pytzdata 2019.1
requests 2.20.0
requests-mock 1.6.0
setuptools 20.10.1 simplejson 3.11.1
singer-python 5.0.4
six 1.12.0
tap-marketo 2.1.1
tzlocal 1.5.1
urllib3 1.24.3

The discover command worked fine

$ ~/.pyenv/versions/tap-marketo/bin/tap-marketo --config config.json --discover > catalog.json

However, running the sync mode exited with a not subscriptable error:

$ ~/.pyenv/versions/tap-marketo/bin/tap-marketo --config config.json --catalog catalog.json CRITICAL 'Catalog' object is not subscriptable Traceback (most recent call last): File "/home/airflow/.pyenv/versions/tap-marketo/bin/tap-marketo", line 9, in load_entry_point('tap-marketo==2.1.1', 'console_scripts', 'tap-marketo')() File "/home/airflow/.pyenv/versions/3.5.2/envs/tap-marketo/lib/python3.5/site-packages/tap_marketo/init.py", line 78, in main raise e File "/home/airflow/.pyenv/versions/3.5.2/envs/tap-marketo/lib/python3.5/site-packages/tap_marketo/init.py", line 75, in main _main(args.config, args.properties or args.catalog, args.state, args.discover) File "/home/airflow/.pyenv/versions/3.5.2/envs/tap-marketo/lib/python3.5/site-packages/tap_marketo/init.py", line 67, in _main state = validate_state(config, properties, state) File "/home/airflow/.pyenv/versions/3.5.2/envs/tap-marketo/lib/python3.5/site-packages/tap_marketo/init.py", line 36, in validate_state for stream in catalog["streams"]: TypeError: 'Catalog' object is not subscriptable

From what I can tell, the Catalog object is not subscriptable based on the source code (https://github.com/singer-io/singer-python/blob/master/singer/catalog.py)

Help would be appreciated.

faumel commented 5 years ago

Closing: Replacing the use of "--catalog" with "--properties" fixes this issue.