Skip to content

Commit

Permalink
fix: Yahoo connector
Browse files Browse the repository at this point in the history
  • Loading branch information
ArslanSaleem committed Sep 19, 2023
1 parent 9d76342 commit 5b47140
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
4 changes: 2 additions & 2 deletions pandasai/connectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ def _load_connector_config(self, config: BaseConnectorConfig):
Returns:
_type_: BaseConnectorConfig
"""
raise NotImplementedError
pass

@abstractmethod
def _init_connection(self, config: BaseConnectorConfig):
"""
make connection to database
"""
raise NotImplementedError
pass

@abstractmethod
def head(self):
Expand Down
20 changes: 0 additions & 20 deletions pandasai/connectors/yahoo_finance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import pandas as pd
from sqlalchemy import create_engine

from .base import YahooFinanceConnectorConfig, BaseConnector
import time
Expand Down Expand Up @@ -35,25 +34,6 @@ def __init__(self, stock_ticker, where=None, cache_interval: int = 600):
super().__init__(yahoo_finance_config)
self.ticker = yfinance.Ticker(self._config.table)

def _load_connector_config(self, config: YahooFinanceConnectorConfig):
"""
Loads passed Configuration to object
Args:
config (BaseConnectorConfig): Construct config in structure
"""
return YahooFinanceConnectorConfig(**config)

def _init_connection(self, config: YahooFinanceConnectorConfig):

self._engine = create_engine(
f"{config.dialect}://{config.username}:{config.password}@{config.host}"
f":{str(config.port)}/{config.database}"
)

self._connection = self._engine.connect()

def head(self):
"""
Return the head of the data source that the connector is connected to.
Expand Down

0 comments on commit 5b47140

Please sign in to comment.