import os
import redis

from urllib.parse import urlparse

redis_url = os.environ.get('REDISCLOUD_URL', 'redis://localhost:6379') 
redis_url_parse = urlparse(redis_url)
redis_client = redis.StrictRedis(host=redis_url_parse.hostname, port=redis_url_parse.port)



from db.db_abstract import AbstractClient
from redis import StrictRedis
from urllib.parse import urlparse

class RedisClient(AbstractClient):

    def __init__(self, url):
        self.url = url
        self.client = None

    def connect(self):
        redis_url = urlparse(self.url)
        self.client = StrictRedis(host=url.hostname, port=url.port, password=url.password)

    def get(self, **kwargs):
        pass

    def set(self, **kwargs):
        pass

    def update(self, **kwargs):
        pass

    def delete(self, **kwargs):
        pass

Update to inherit from abstract class
Update to inherit from abstract class

+ from db.db_abstract import AbstractClient
+ from redis import StrictRedis
- import os
- import redis
- 
  from urllib.parse import urlparse
  
+ class RedisClient(AbstractClient):
- redis_url = os.environ.get('REDISCLOUD_URL', 'redis://localhost:6379') 
- redis_url_parse = urlparse(redis_url)
- redis_client = redis.StrictRedis(host=redis_url_parse.hostname, port=redis_url_parse.port)
  
+     def __init__(self, url):
+         self.url = url
+         self.client = None
  
+     def connect(self):
+         redis_url = urlparse(self.url)
+         self.client = StrictRedis(host=url.hostname, port=url.port, password=url.password)
  
+     def get(self, **kwargs):
+         pass
+ 
+     def set(self, **kwargs):
+         pass
+ 
+     def update(self, **kwargs):
+         pass
+ 
+     def delete(self, **kwargs):
+         pass
+ 
Update to inherit from abstract class
## Code Before:
import os
import redis

from urllib.parse import urlparse

redis_url = os.environ.get('REDISCLOUD_URL', 'redis://localhost:6379') 
redis_url_parse = urlparse(redis_url)
redis_client = redis.StrictRedis(host=redis_url_parse.hostname, port=redis_url_parse.port)



## Instruction:
Update to inherit from abstract class
## Code After:
from db.db_abstract import AbstractClient
from redis import StrictRedis
from urllib.parse import urlparse

class RedisClient(AbstractClient):

    def __init__(self, url):
        self.url = url
        self.client = None

    def connect(self):
        redis_url = urlparse(self.url)
        self.client = StrictRedis(host=url.hostname, port=url.port, password=url.password)

    def get(self, **kwargs):
        pass

    def set(self, **kwargs):
        pass

    def update(self, **kwargs):
        pass

    def delete(self, **kwargs):
        pass
