Skip to content

Commit 19a6f5c

Browse files
committed
Drop marketstore mod import from CLIs loader
Means commenting out the `data.cli.ingest()` as it will be deleted in the up coming #486 anyway.
1 parent 7d84b5a commit 19a6f5c

File tree

2 files changed

+49
-51
lines changed

2 files changed

+49
-51
lines changed

piker/cli/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,6 @@ async def list_services():
226226

227227

228228
def _load_clis() -> None:
229-
from ..service import marketstore # noqa
230-
from ..service import elastic
231229
from ..data import cli # noqa
232230
from ..brokers import cli # noqa
233231
from ..ui import cli # noqa

piker/data/cli.py

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
import tractor
2323
import click
2424

25-
from ..service.marketstore import (
26-
# get_client,
27-
# stream_quotes,
28-
ingest_quote_stream,
29-
# _url,
30-
# _tick_tbk_ids,
31-
# mk_tbk,
32-
)
25+
# from ..service.marketstore import (
26+
# # get_client,
27+
# # stream_quotes,
28+
# ingest_quote_stream,
29+
# # _url,
30+
# # _tick_tbk_ids,
31+
# # mk_tbk,
32+
# )
3333
from ..cli import cli
3434
from .. import watchlists as wl
3535
from ._util import (
@@ -212,44 +212,44 @@ async def main():
212212
trio.run(main)
213213

214214

215-
@cli.command()
216-
@click.option('--test-file', '-t', help='Test quote stream file')
217-
@click.option('--tl', is_flag=True, help='Enable tractor logging')
218-
@click.argument('name', nargs=1, required=True)
219-
@click.pass_obj
220-
def ingest(config, name, test_file, tl):
221-
'''
222-
Ingest real-time broker quotes and ticks to a marketstore instance.
223-
224-
'''
225-
# global opts
226-
loglevel = config['loglevel']
227-
tractorloglevel = config['tractorloglevel']
228-
# log = config['log']
229-
230-
watchlist_from_file = wl.ensure_watchlists(config['wl_path'])
231-
watchlists = wl.merge_watchlist(watchlist_from_file, wl._builtins)
232-
symbols = watchlists[name]
233-
234-
grouped_syms = {}
235-
for sym in symbols:
236-
symbol, _, provider = sym.rpartition('.')
237-
if provider not in grouped_syms:
238-
grouped_syms[provider] = []
239-
240-
grouped_syms[provider].append(symbol)
241-
242-
async def entry_point():
243-
async with tractor.open_nursery() as n:
244-
for provider, symbols in grouped_syms.items():
245-
await n.run_in_actor(
246-
ingest_quote_stream,
247-
name='ingest_marketstore',
248-
symbols=symbols,
249-
brokername=provider,
250-
tries=1,
251-
actorloglevel=loglevel,
252-
loglevel=tractorloglevel
253-
)
254-
255-
tractor.run(entry_point)
215+
# @cli.command()
216+
# @click.option('--test-file', '-t', help='Test quote stream file')
217+
# @click.option('--tl', is_flag=True, help='Enable tractor logging')
218+
# @click.argument('name', nargs=1, required=True)
219+
# @click.pass_obj
220+
# def ingest(config, name, test_file, tl):
221+
# '''
222+
# Ingest real-time broker quotes and ticks to a marketstore instance.
223+
224+
# '''
225+
# # global opts
226+
# loglevel = config['loglevel']
227+
# tractorloglevel = config['tractorloglevel']
228+
# # log = config['log']
229+
230+
# watchlist_from_file = wl.ensure_watchlists(config['wl_path'])
231+
# watchlists = wl.merge_watchlist(watchlist_from_file, wl._builtins)
232+
# symbols = watchlists[name]
233+
234+
# grouped_syms = {}
235+
# for sym in symbols:
236+
# symbol, _, provider = sym.rpartition('.')
237+
# if provider not in grouped_syms:
238+
# grouped_syms[provider] = []
239+
240+
# grouped_syms[provider].append(symbol)
241+
242+
# async def entry_point():
243+
# async with tractor.open_nursery() as n:
244+
# for provider, symbols in grouped_syms.items():
245+
# await n.run_in_actor(
246+
# ingest_quote_stream,
247+
# name='ingest_marketstore',
248+
# symbols=symbols,
249+
# brokername=provider,
250+
# tries=1,
251+
# actorloglevel=loglevel,
252+
# loglevel=tractorloglevel
253+
# )
254+
255+
# tractor.run(entry_point)

0 commit comments

Comments
 (0)