Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

291 bug #292

Merged
merged 9 commits into from
Jun 10, 2019
2 changes: 1 addition & 1 deletion scripts/utils/argschecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def get_docs_mask_dict(self):
'date_header': self.args.date_header
}

if self.args.date_to is not None and self.args.date_from is not None:
if self.args.date_to is not None or self.args.date_from is not None:
date_to = pd.to_datetime('today').date() if self.args.date_to is None else pd.to_datetime(self.args.date_to)
date_from = pd.to_datetime('1900-01-01') if self.args.date_from is None else pd.to_datetime(
self.args.date_from)
Expand Down
18 changes: 10 additions & 8 deletions tests/test_documents_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
class TestDocumentsFilter(unittest.TestCase):

def setUp(self):
self.__docs_mask_dict = {}
self.__docs_mask_dict['filter_by'] = 'union'
self.__docs_mask_dict['cpc'] = None
self.__docs_mask_dict['time'] = None
self.__docs_mask_dict['cite'] = []
self.__docs_mask_dict['columns'] = None
self.__docs_mask_dict['date'] = None
self.__docs_mask_dict['date_header'] = 'publication_date'

self.__docs_mask_dict = {
'filter_by': 'union',
'cpc': None,
'time': None,
'cite': [],
'columns': None,
'date': None,
'date_header': 'publication_date'
}

# [self.args.year_from, year_to, self.args.month_from, month_to, self.args.date_header]

Expand Down