Commit
•
21c2d6e
1
Parent(s):
c3395ab
Update db_operations/db_read.py
Browse files- db_operations/db_read.py +4 -2
db_operations/db_read.py
CHANGED
@@ -37,7 +37,7 @@ class DBRead:
|
|
37 |
rss_df = pd.DataFrame(docs)
|
38 |
except Exception as insert_err:
|
39 |
self.__error = 1
|
40 |
-
rss_df =
|
41 |
return rss_df
|
42 |
|
43 |
def __close_connection(self):
|
@@ -47,7 +47,7 @@ class DBRead:
|
|
47 |
|
48 |
def read_news_from_db(self):
|
49 |
logger.warning('Entering read_news_from_db() to read old news')
|
50 |
-
rss_df =
|
51 |
if self.url is not None:
|
52 |
if self.__error == 0:
|
53 |
self.__connect()
|
@@ -58,4 +58,6 @@ class DBRead:
|
|
58 |
if self.__client is not None:
|
59 |
self.__close_connection()
|
60 |
logger.warning('Entering read_news_from_db()')
|
|
|
|
|
61 |
return rss_df
|
|
|
37 |
rss_df = pd.DataFrame(docs)
|
38 |
except Exception as insert_err:
|
39 |
self.__error = 1
|
40 |
+
rss_df = pd.DataFrame()
|
41 |
return rss_df
|
42 |
|
43 |
def __close_connection(self):
|
|
|
47 |
|
48 |
def read_news_from_db(self):
|
49 |
logger.warning('Entering read_news_from_db() to read old news')
|
50 |
+
rss_df = pd.DataFrame()
|
51 |
if self.url is not None:
|
52 |
if self.__error == 0:
|
53 |
self.__connect()
|
|
|
58 |
if self.__client is not None:
|
59 |
self.__close_connection()
|
60 |
logger.warning('Entering read_news_from_db()')
|
61 |
+
if len(rss_df) == 0:
|
62 |
+
rss_df = None
|
63 |
return rss_df
|