mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 16:26:55 +08:00
fix_pylint_for_CI (#1119)
* fix_pylint_for_CI * reformat_with_black * fix_pylint_C3001 * fix_flake8_error
This commit is contained in:
@@ -63,11 +63,20 @@ def _get_date_parse_fn(target):
|
||||
get_date_parse_fn(20120101)('2017-01-01') => 20170101
|
||||
"""
|
||||
if isinstance(target, int):
|
||||
_fn = lambda x: int(str(x).replace("-", "")[:8]) # 20200201
|
||||
|
||||
def _fn(x):
|
||||
return int(str(x).replace("-", "")[:8]) # 20200201
|
||||
|
||||
elif isinstance(target, str) and len(target) == 8:
|
||||
_fn = lambda x: str(x).replace("-", "")[:8] # '20200201'
|
||||
|
||||
def _fn(x):
|
||||
return str(x).replace("-", "")[:8] # '20200201'
|
||||
|
||||
else:
|
||||
_fn = lambda x: x # '2021-01-01'
|
||||
|
||||
def _fn(x):
|
||||
return x # '2021-01-01'
|
||||
|
||||
return _fn
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user