From 5b47140a71c76c432734c0a3f48c132562cdaa68 Mon Sep 17 00:00:00 2001 From: ArslanSaleem Date: Tue, 19 Sep 2023 15:26:40 +0500 Subject: [PATCH] fix: Yahoo connector --- pandasai/connectors/base.py | 4 ++-- pandasai/connectors/yahoo_finance.py | 20 -------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/pandasai/connectors/base.py b/pandasai/connectors/base.py index c381385bc..130ead094 100644 --- a/pandasai/connectors/base.py +++ b/pandasai/connectors/base.py @@ -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): diff --git a/pandasai/connectors/yahoo_finance.py b/pandasai/connectors/yahoo_finance.py index 52d39ea70..cae4e263d 100644 --- a/pandasai/connectors/yahoo_finance.py +++ b/pandasai/connectors/yahoo_finance.py @@ -1,6 +1,5 @@ import os import pandas as pd -from sqlalchemy import create_engine from .base import YahooFinanceConnectorConfig, BaseConnector import time @@ -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.