diff --git a/examples/jdbc.ipynb b/examples/jdbc.ipynb index d76bb1ce..fc4d680a 100644 --- a/examples/jdbc.ipynb +++ b/examples/jdbc.ipynb @@ -3201,7 +3201,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -3220,7 +3220,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 3, "metadata": {}, "outputs": [ { diff --git a/optimus/io/factory.py b/optimus/io/factory.py index 863951ba..5c4cd5f8 100644 --- a/optimus/io/factory.py +++ b/optimus/io/factory.py @@ -6,6 +6,7 @@ from optimus.io.postgresql import PostgreSQLDriver from optimus.io.presto import PrestoDriver from optimus.io.properties import DriverProperties +from optimus.io.redis import RedisDriver from optimus.io.redshift import RedshiftDriver from optimus.io.sqlite import SQLiteDriver from optimus.io.sqlserver import SQLServerDriver @@ -49,6 +50,6 @@ def get(driver_type) -> AbstractDriver: elif driver_type == DriverProperties.SQLSERVER.value["name"]: return SQLServerDriver() elif driver_type == DriverProperties.REDIS.value["name"]: - return SQLServerDriver() + return RedisDriver() else: RaiseIt.value_error(driver_type, [database["name"] for database in DriverProperties.list()]) diff --git a/optimus/io/redis.py b/optimus/io/redis.py new file mode 100644 index 00000000..fcbf8e6d --- /dev/null +++ b/optimus/io/redis.py @@ -0,0 +1,27 @@ +from enum import Enum + +from singleton_decorator import singleton + +from optimus.io.abstract_driver import AbstractDriver +from optimus.io.properties import DriverProperties + + +@singleton +class RedisDriver(AbstractDriver): + """Redis Database""" + + def properties(self) -> Enum: + return DriverProperties.REDIS + + def url(self, *args, **kwarg) -> str: + # Redis pyspark do not use and url + pass + + def table_names_query(self, *args, **kwargs) -> str: + pass + + def table_name_query(self, *args, **kwargs) -> str: + pass + + def count_query(self, *args, **kwargs) -> str: + pass