Skip to content

Commit

Permalink
Fix Redis Driver
Browse files Browse the repository at this point in the history
  • Loading branch information
argenisleon committed Nov 30, 2019
1 parent e720adb commit ac36f8e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/jdbc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3201,7 +3201,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -3220,7 +3220,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down
3 changes: 2 additions & 1 deletion optimus/io/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()])
27 changes: 27 additions & 0 deletions optimus/io/redis.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ac36f8e

Please sign in to comment.