Commit 04962c48 authored by Dr.李's avatar Dr.李

FEATURE: switch map industry name

parent 92502036
...@@ -5,6 +5,7 @@ Created on 2017-12-25 ...@@ -5,6 +5,7 @@ Created on 2017-12-25
@author: cheng.li @author: cheng.li
""" """
import os
from typing import Dict from typing import Dict
from typing import Iterable from typing import Iterable
...@@ -51,7 +52,20 @@ def _map_factors(factors: Iterable[str], used_factor_tables) -> Dict: ...@@ -51,7 +52,20 @@ def _map_factors(factors: Iterable[str], used_factor_tables) -> Dict:
return factor_cols return factor_cols
def _map_industry_category(category: str) -> str: if "DB_VENDOR" in os.environ and os.environ["DB_VENDOR"].lower() == "rl":
def _map_industry_category(category: str) -> str:
if category == 'sw':
return '申万行业分类(2014)'
elif category == 'zz':
return '中证行业分类'
elif category == 'zx':
return '中信标普行业分类'
elif category == 'zjh':
return '证监会行业分类(2012)-证监会'
else:
raise ValueError("No other industry is supported at the current time")
else:
def _map_industry_category(category: str) -> str:
if category == 'sw': if category == 'sw':
return '申万行业分类' return '申万行业分类'
elif category == 'sw_adj': elif category == 'sw_adj':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment