mirror of
https://github.com/status-im/airbyte-custom-connector.git
synced 2025-02-17 03:16:36 +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):
|
||||
url_base = 'https://api.coingecko.com/api/v3/coins/'
|
||||
|
||||
primary_key = None
|
||||
|
||||
def __init__(self, coins: List['str'], **kwargs):
|
||||
@ -46,7 +45,7 @@ class CoinPrice(HttpStream):
|
||||
logger.info("Parsing Coin Gecko data for %s", coin)
|
||||
market_chart = response.json()
|
||||
yield {
|
||||
"coin": coin,
|
||||
"name": coin,
|
||||
"date": datetime.today().strftime('%Y%m%d_%H%M'),
|
||||
# The first value of the prices objects is weird
|
||||
"price": market_chart['prices'][1][1],
|
||||
@ -55,7 +54,7 @@ class CoinPrice(HttpStream):
|
||||
# Source
|
||||
class SourceCryptoMarketExtractor(AbstractSource):
|
||||
def check_connection(self, logger, config) -> Tuple[bool, any]:
|
||||
return True, None
|
||||
return True, None
|
||||
|
||||
def streams(self, config: Mapping[str, Any]) -> List[Stream]:
|
||||
logger.info('Config : %s', config['coins'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user