emcp
10/25/2021, 11:14 PMtarget-postgres | loader | time=2021-10-26 01:09:51 name=target_postgres level=ERROR message=Unable to parse:
target-postgres | loader | Database connected, dbname = mydb_name username = juju_meltano
target-postgres | loader |
target-postgres | loader | Traceback (most recent call last):
target-postgres | loader | File "/home/ubuntu/meltano_proj_repo/.meltano/loaders/target-postgres/venv/bin/target-postgres", line 8, in <module>
target-postgres | loader | sys.exit(main())
target-postgres | loader | File "/home/ubuntu/meltano_proj_repo/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/__init__.py", line 373, in main
target-postgres | loader | persist_lines(config, singer_messages)
target-postgres | loader | File "/home/ubuntu/meltano_proj_repo/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/__init__.py", line 101, in persist_lines
target-postgres | loader | o = json.loads(line)
target-postgres | loader | File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
target-postgres | loader | return _default_decoder.decode(s)
target-postgres | loader | File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
target-postgres | loader | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
target-postgres | loader | File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
target-postgres | loader | raise JSONDecodeError("Expecting value", s, err.value) from None
target-postgres | loader | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Has the transferwise variant been supplanted in the move to meltanohub or ?
I think my input looks fine and I've double checked some of it by just copy-pasting it into VSCode and having it lint itaaronsteers
10/25/2021, 11:18 PM--log-level=DEBUG
in case that offers another clue?emcp
10/25/2021, 11:22 PMemcp
10/25/2021, 11:23 PMemcp
10/25/2021, 11:24 PMemcp
10/25/2021, 11:26 PM- name: tap-ibkr-tickers
namespace: tap_ibkr
catalog: extract/tap-ibkr-tickers.catalog.json
executable: /stonks-tap-ibkr/tap-ibkr/tap-ibkr.sh
config:
host_tws_thrift: 127.0.0.1
tws_thrift_port: 9090
- name: tap-ibkr-news
namespace: tap_ibkr
executable: /stonks-tap-ibkr/tap-ibkr/tap-ibkr.sh
catalog: extract/tap-ibkr-news.catalog.json
config:
host_tws_thrift: 127.0.0.1
tws_thrift_port: 9090
target_host: 1.2.3.4
target_username: myusername
target_password: 1234
loaders:
- name: target-postgres
variant: transferwise
pip_url: git+<https://github.com/transferwise/pipelinewise-target-postgres.git>
config:
host: 1.2.3.4
port: 5432
user: myusername
password: 1234
dbname: stonks
schema: public
emcp
10/25/2021, 11:32 PMmeltano invoke tap-ibkr-news
```Installing the current project: tap-ibkr (0.0.2)
time=2021-10-26 012725 name=tap-ibkr level=INFO message=tap-ibkr v0.0.2, Meltano SDK v0.3.10)
time=2021-10-26 012725 name=tap-ibkr level=INFO message=Skipping parse of env var settings...
time=2021-10-26 012725 name=tap-ibkr level=INFO message=Config validation passed with 0 errors and 0 warnings.
time=2021-10-26 012725 name=root level=INFO message=Operator '{MAPPER_ELSE_OPTION}=None' was not found. Unmapped streams will be included in output.
time=2021-10-26 012725 name=tap-ibkr level=INFO message=Beginning full_table sync of 'ib_news'...
time=2021-10-26 012725 name=tap-ibkr level=INFO message=Tap has custom mapper. Using 1 provided map(s).
{"type": "SCHEMA", "stream": "ib_news", "schema": {"properties": {"symbol": {"type": ["string", "null"]}, "contract_id": {"type": ["integer", "null"]}, "contract_id_query_datetime_max": {"format": "date-time", "type": ["string", "null"]}, "provider_code": {"type": ["string", "null"]}, "article_id": {"type": ["string", "null"]}, "article_timestamp": {"format": "date-time", "type": ["string", "null"]}, "headline": {"type": ["string", "null"]}, "extra_data": {"type": ["string", "null"]}, "query_start_time": {"format": "date-time", "type": ["string", "null"]}}, "type": "object"}, "key_properties": ["article_id"]}
time=2021-10-26 012725 name=tap-ibkr level=INFO message=Beginning by gathering latest ticker symbols known!
Database connected, dbname = stonks username = juju_meltano
time=2021-10-26 012725 name=tap-ibkr level=INFO message=Now we take those good symbols and query IBKR!
time=2021-10-26 012725 name=tap-ibkr level=INFO message=connected to IBKR, beginning query of news... with 29816 results
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "rytm", "contract_id": 291378079, "article_id": "BRFUPDN$0f89bb2b", "headline": "BofA Securities downgraded Rhythm Pharmaceuticals (RYTM) to Underperform with target $17", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723084Z"}
{"type": "STATE", "value": {"bookmarks": {"ib_news": {}}}}
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "rytm", "contract_id": 291378079, "article_id": "BRFUPDN$0f89bb2d", "headline": "", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723261Z"}
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "rytm", "contract_id": 291378079, "article_id": "BRFUPDN$0fcc8ed1", "headline": "", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723316Z"}
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "form", "contract_id": 18416237, "article_id": "BRFUPDN$0f19c9df", "headline": "", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723368Z"}
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "form", "contract_id": 18416237, "article_id": "BRFUPDN$0f3ac696", "headline": "", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723410Z"}
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "form", "contract_id": 18416237, "article_id": "BRFUPDN$0f778f32", "headline": "", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723451Z"}
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "mnkd", "contract_id": 268671846, "article_id": "BRFUPDN$0ef82c1f", "headline": "", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723492Z"}
{"type": "RECORD", "stream": "ib_news", "record": {"symbol": "mpw", "contract_id": 35111040, "article_id": "BRFUPDN$0ee361f7", "headline": "", "query_start_time": "2021-10-25T232725.606646Z"}, "time_extracted": "2021-10-25T232735.723533Z"}
{"type": "RECORD", "stream": "ib_news"…emcp
10/25/2021, 11:34 PMarticle_id
when querying news.. so I must need to fix my catalog request
time=2021-10-26 01:27:35 name=tap-ibkr level=WARNING message=Property 'article_id' was present in the 'ib_tickers' stream but not found in catalog schema. Ignoring.
time=2021-10-26 01:27:35 name=tap-ibkr level=WARNING message=Property 'alphabet_partition' was present in the 'ib_tickers' stream but not found in catalog schema. Ignoring.
visch
10/26/2021, 12:04 AMvisch
10/26/2021, 12:05 AM/home/ubuntu/meltano_proj_repo/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/__init__.py", line 101, in persist_lines
and add a log.info on the record right before line 101visch
10/26/2021, 12:05 AMemcp
10/26/2021, 6:57 AMemcp
10/26/2021, 6:58 AMemcp
10/26/2021, 2:42 PMemcp
10/26/2021, 6:20 PMNone
or emptyemcp
10/26/2021, 6:21 PMemcp
10/26/2021, 6:21 PMemcp
10/26/2021, 6:22 PMemcp
10/26/2021, 6:22 PMemcp
10/26/2021, 6:29 PMemcp
10/26/2021, 6:29 PMemcp
10/26/2021, 6:54 PMemcp
10/26/2021, 6:57 PMemcp
10/26/2021, 6:57 PMvisch
10/26/2021, 7:01 PMselect
attribute anything selected is used, things not selected are notvisch
10/26/2021, 7:01 PMemcp
10/26/2021, 7:07 PMMeltano makes it easy to select specific entities and attributes for inclusion or exclusion using meltano select and the select extractor extra, which let you specify inclusion and exclusion rules that can contain Unix shell-style wildcards to match multiple entities and/or attributes at once.
so.. yeah was totally missing that and was trying to submit catalogs as my selectionemcp
10/26/2021, 7:08 PMselect
guessing it's something like thisemcp
10/26/2021, 7:09 PM- name: tap-ibkr-news
namespace: tap_ibkr
executable: /stonks-tap-ibkr/tap-ibkr/tap-ibkr.sh
select: "insert some logic to ignore ticker symbols"
config:
host_tws_thrift: 127.0.0.1
tws_thrift_port: 9090
target_host: 1.2.3.4
target_username: myusername
target_password: 1234
visch
10/26/2021, 7:09 PMvisch
10/26/2021, 7:09 PMselect: "insert some logic to ignore ticker symbols"
Well it's normally setup as you select streams, you don't filter out values of dataemcp
10/26/2021, 7:10 PMvisch
10/26/2021, 7:10 PMselect:
- "stocks.*"
would select your stocks but not your newsemcp
10/26/2021, 7:11 PMfrom singer_sdk import typing as th # JSON Schema typing helpers
from tap_ibkr.client import IBKRStream, KludgeStream
from tap_ibkr.utils.getAllPossibleSymbols import get_all_tickers
class TickersStream(IBKRStream):
name = "ib_tickers"
primary_keys = ["contract_id", "query_start_time"]
replication_key = None
partitions = get_all_tickers()
schema = th.PropertiesList(
th.Property("symbol", th.StringType),
th.Property("sec_type", th.StringType),
th.Property("primary_exchange", th.StringType),
th.Property("exchange", th.StringType),
th.Property("currency", th.StringType),
th.Property("contract_id", th.IntegerType),
th.Property("query_start_time", th.DateTimeType)
).to_dict()
class NewsStream(KludgeStream):
name = "ib_news"
primary_keys = ["article_id"]
replication_key = None
schema = th.PropertiesList(
th.Property("symbol", th.StringType),
th.Property("contract_id", th.IntegerType),
th.Property("provider_code", th.StringType),
th.Property("article_id", th.StringType),
th.Property("article_timestamp", th.DateTimeType),
th.Property("headline", th.StringType),
th.Property("extra_data", th.StringType),
th.Property("query_start_time", th.DateTimeType)
).to_dict()
So my select for news will be
select:
- "ib_news.*"
visch
10/26/2021, 7:11 PMemcp
10/26/2021, 7:12 PMemcp
10/26/2021, 7:12 PMemcp
10/26/2021, 7:13 PMemcp
10/26/2021, 7:13 PMemcp
10/26/2021, 7:13 PMvisch
10/26/2021, 7:13 PMemcp
10/26/2021, 7:14 PMemcp
10/26/2021, 7:14 PMemcp
10/26/2021, 7:15 PMemcp
10/26/2021, 7:15 PMemcp
10/26/2021, 7:16 PMemcp
10/26/2021, 7:16 PMvisch
10/26/2021, 7:18 PMvisch
10/26/2021, 7:19 PMemcp
10/26/2021, 8:01 PMplugins:
extractors:
- name: tap-ibkr-tickers
select:
- "ib_tickers.*"
namespace: tap_ibkr
executable: /home/emcp/Dev/git/JRGEMCP_STONKS/stonks-tap-ibkr/tap-ibkr/tap-ibkr.sh
config:
host_tws_thrift: 127.0.0.1
tws_thrift_port: 9090
- name: tap-ibkr-news
select:
- "ib_news.*"
I'll try to look deeper into the docs..visch
10/26/2021, 8:03 PMvisch
10/26/2021, 8:03 PMvisch
10/26/2021, 8:03 PMtap-ibkr-tickers
or tap-ibkr-news
and does tap-ibkr-news
have inheirt_from on it?emcp
10/26/2021, 8:03 PMemcp
10/26/2021, 8:04 PMemcp
10/26/2021, 8:04 PM- name: ibkr-to-postgres-tickers
extractor: tap-ibkr-tickers
loader: target-postgres
transform: skip
interval: '@once'
start_date: 2021-09-06 20:53:11.568572
- name: ibkr-to-postgres-news
extractor: tap-ibkr-news
loader: target-postgres
transform: skip
interval: '@once'
start_date: 2021-09-06 20:53:11.568572
emcp
10/26/2021, 8:09 PMemcp
10/26/2021, 8:09 PMemcp
10/26/2021, 8:11 PMemcp
10/26/2021, 8:11 PMemcp
10/26/2021, 8:21 PM(meltano) ubuntu@juju-2dd159-248:~/meltano_proj_repo$ meltano select --list tap_ibkr
Extractor 'tap_ibkr' is not known to Meltano
(meltano) ubuntu@juju-2dd159-248:~/meltano_proj_repo$ meltano select --list tap-ibkr
Extractor 'tap-ibkr' is not known to Meltano
(meltano) ubuntu@juju-2dd159-248:~/meltano_proj_repo$ meltano select --list tap-ibkr-news
Cannot list the selected attributes: Could not find catalog. Verify that the tap supports discovery mode and advertises the `discover` capability as well as either `catalog` or `properties`
(meltano) ubuntu@juju-2dd159-248:~/meltano_proj_repo$ meltano select --list tap-ibkr-tickers
Cannot list the selected attributes: Could not find catalog. Verify that the tap supports discovery mode and advertises the `discover` capability as well as either `catalog` or `properties`
(meltano) ubuntu@juju-2dd159-248:~/meltano_proj_repo$
seems I need to do some work on my tapemcp
10/27/2021, 10:33 AMemcp
10/27/2021, 10:34 AMemcp
10/27/2021, 4:05 PMselect
correctly and
2. if it needs custom tap code how or where do I start