mirror of
https://github.com/status-im/airbyte-custom-connector.git
synced 2025-02-20 04:38:22 +00:00
source-crypto-market-extractor: Fixing coin name missing
Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
parent
ebf65b1b78
commit
8ec37e115b
@ -16,7 +16,6 @@ logger = logging.getLogger("airbyte")
|
|||||||
|
|
||||||
class CoinPrice(HttpStream):
|
class CoinPrice(HttpStream):
|
||||||
url_base = 'https://api.coingecko.com/api/v3/coins/'
|
url_base = 'https://api.coingecko.com/api/v3/coins/'
|
||||||
|
|
||||||
primary_key = None
|
primary_key = None
|
||||||
|
|
||||||
def __init__(self, coins: List['str'], **kwargs):
|
def __init__(self, coins: List['str'], **kwargs):
|
||||||
@ -46,7 +45,7 @@ class CoinPrice(HttpStream):
|
|||||||
logger.info("Parsing Coin Gecko data for %s", coin)
|
logger.info("Parsing Coin Gecko data for %s", coin)
|
||||||
market_chart = response.json()
|
market_chart = response.json()
|
||||||
yield {
|
yield {
|
||||||
"coin": coin,
|
"name": coin,
|
||||||
"date": datetime.today().strftime('%Y%m%d_%H%M'),
|
"date": datetime.today().strftime('%Y%m%d_%H%M'),
|
||||||
# The first value of the prices objects is weird
|
# The first value of the prices objects is weird
|
||||||
"price": market_chart['prices'][1][1],
|
"price": market_chart['prices'][1][1],
|
||||||
@ -55,7 +54,7 @@ class CoinPrice(HttpStream):
|
|||||||
# Source
|
# Source
|
||||||
class SourceCryptoMarketExtractor(AbstractSource):
|
class SourceCryptoMarketExtractor(AbstractSource):
|
||||||
def check_connection(self, logger, config) -> Tuple[bool, any]:
|
def check_connection(self, logger, config) -> Tuple[bool, any]:
|
||||||
return True, None
|
return True, None
|
||||||
|
|
||||||
def streams(self, config: Mapping[str, Any]) -> List[Stream]:
|
def streams(self, config: Mapping[str, Any]) -> List[Stream]:
|
||||||
logger.info('Config : %s', config['coins'])
|
logger.info('Config : %s', config['coins'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user