pass pairs down
This commit is contained in:
parent
92eca9e06b
commit
2432b7d6dc
2 changed files with 8 additions and 3 deletions
|
|
@ -91,6 +91,7 @@ def get_rates(
|
||||||
start_date=start_date,
|
start_date=start_date,
|
||||||
end_date=end_date,
|
end_date=end_date,
|
||||||
currencies=currencies,
|
currencies=currencies,
|
||||||
|
pairs=pairs,
|
||||||
dry_run=dry_run,
|
dry_run=dry_run,
|
||||||
rates_source=rates_source,
|
rates_source=rates_source,
|
||||||
ignore_warnings=ignore_warnings,
|
ignore_warnings=ignore_warnings,
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
from typing import List
|
from typing import List, Set, Union
|
||||||
|
|
||||||
from money.currency import Currency
|
from money.currency import Currency
|
||||||
from xecd_rates_client import XecdClient
|
from xecd_rates_client import XecdClient
|
||||||
|
|
||||||
from xexe.constants import RATES_SOURCES
|
from xexe.constants import RATES_SOURCES
|
||||||
|
from xexe.currency_pair import CurrencyPair
|
||||||
from xexe.exchange_rates import ExchangeRates, add_equal_rates, add_inverse_rates
|
from xexe.exchange_rates import ExchangeRates, add_equal_rates, add_inverse_rates
|
||||||
from xexe.rate_fetching import build_rate_fetcher
|
from xexe.rate_fetching import build_rate_fetcher
|
||||||
from xexe.rate_writing import build_rate_writer
|
from xexe.rate_writing import build_rate_writer
|
||||||
|
|
@ -67,11 +68,12 @@ def run_dwh_healthcheck():
|
||||||
|
|
||||||
def run_get_rates(
|
def run_get_rates(
|
||||||
date_range: DateRange,
|
date_range: DateRange,
|
||||||
currencies: List[Currency],
|
|
||||||
dry_run: bool,
|
dry_run: bool,
|
||||||
rates_source: str,
|
rates_source: str,
|
||||||
ignore_warnings: bool,
|
ignore_warnings: bool,
|
||||||
output: pathlib.Path,
|
output: pathlib.Path,
|
||||||
|
currencies: Union[Set[Currency], None] = None,
|
||||||
|
pairs: Union[Set[CurrencyPair], None] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
logger.info("Getting rates")
|
logger.info("Getting rates")
|
||||||
|
|
||||||
|
|
@ -80,6 +82,7 @@ def run_get_rates(
|
||||||
rates = obtain_rates_from_source(
|
rates = obtain_rates_from_source(
|
||||||
rates_source=rates_source,
|
rates_source=rates_source,
|
||||||
date_range=date_range,
|
date_range=date_range,
|
||||||
|
pairs=pairs,
|
||||||
currencies=currencies,
|
currencies=currencies,
|
||||||
ignore_warnings=ignore_warnings,
|
ignore_warnings=ignore_warnings,
|
||||||
)
|
)
|
||||||
|
|
@ -95,8 +98,9 @@ def run_get_rates(
|
||||||
def obtain_rates_from_source(
|
def obtain_rates_from_source(
|
||||||
rates_source: str,
|
rates_source: str,
|
||||||
date_range: DateRange,
|
date_range: DateRange,
|
||||||
currencies: List[Currency],
|
|
||||||
ignore_warnings: bool,
|
ignore_warnings: bool,
|
||||||
|
currencies: Union[Set[Currency], None] = None,
|
||||||
|
pairs: Union[Set[CurrencyPair], None] = None,
|
||||||
) -> ExchangeRates:
|
) -> ExchangeRates:
|
||||||
rates_fetcher = build_rate_fetcher(
|
rates_fetcher = build_rate_fetcher(
|
||||||
rates_source=rates_source, rate_sources_mapping=RATES_SOURCES
|
rates_source=rates_source, rate_sources_mapping=RATES_SOURCES
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue