Merge pull request #2810 from dokson/fix/extract-repair-ticker-overrides
Simplify phantom-dividend repair branch + drive-by typo/lint fixes
This commit is contained in:
@@ -95,17 +95,17 @@ class Industry(Domain):
|
||||
Returns:
|
||||
Optional[pd.DataFrame]: DataFrame containing parsed top performing companies data.
|
||||
"""
|
||||
compnaies_column = ['symbol','name','ytd return','last price','target price']
|
||||
compnaies_values = [(c.get('symbol', None),
|
||||
companies_column = ['symbol','name','ytd return','last price','target price']
|
||||
companies_values = [(c.get('symbol', None),
|
||||
c.get('name', None),
|
||||
c.get('ytdReturn',{}).get('raw', None),
|
||||
c.get('lastPrice',{}).get('raw', None),
|
||||
c.get('targetPrice',{}).get('raw', None),) for c in top_performing_companies]
|
||||
|
||||
if not compnaies_values:
|
||||
if not companies_values:
|
||||
return None
|
||||
|
||||
return _pd.DataFrame(compnaies_values, columns = compnaies_column).set_index('symbol')
|
||||
return _pd.DataFrame(companies_values, columns = companies_column).set_index('symbol')
|
||||
|
||||
def _parse_top_growth_companies(self, top_growth_companies: Dict) -> Optional[_pd.DataFrame]:
|
||||
"""
|
||||
@@ -117,16 +117,16 @@ class Industry(Domain):
|
||||
Returns:
|
||||
Optional[pd.DataFrame]: DataFrame containing parsed top growth companies data.
|
||||
"""
|
||||
compnaies_column = ['symbol','name','ytd return','growth estimate']
|
||||
compnaies_values = [(c.get('symbol', None),
|
||||
companies_column = ['symbol','name','ytd return','growth estimate']
|
||||
companies_values = [(c.get('symbol', None),
|
||||
c.get('name', None),
|
||||
c.get('ytdReturn',{}).get('raw', None),
|
||||
c.get('growthEstimate',{}).get('raw', None),) for c in top_growth_companies]
|
||||
|
||||
if not compnaies_values:
|
||||
if not companies_values:
|
||||
return None
|
||||
|
||||
return _pd.DataFrame(compnaies_values, columns = compnaies_column).set_index('symbol')
|
||||
return _pd.DataFrame(companies_values, columns = companies_column).set_index('symbol')
|
||||
|
||||
def _fetch_and_parse(self) -> None:
|
||||
"""
|
||||
|
||||
@@ -2250,8 +2250,7 @@ class PriceHistory:
|
||||
if c == 'adj_exceeds_prices':
|
||||
continue
|
||||
|
||||
if c == 'phantom' and self.ticker in ['KAP.IL', 'SAND']:
|
||||
# Manually approve, but these are probably safe to assume ok
|
||||
if c == 'phantom':
|
||||
continue
|
||||
|
||||
if c == 'div_date_wrong':
|
||||
@@ -2729,7 +2728,8 @@ class PriceHistory:
|
||||
df_workings['VolStr'] = ''
|
||||
df_workings.loc[fna, 'VolStr'] = 'NaN'
|
||||
df_workings.loc[~fna, 'VolStr'] = (df_workings['Vol'][~fna]/1e6).astype('int').astype('str') + 'm'
|
||||
df_workings['Vol'] = df_workings['VolStr'] ; df_workings.drop('VolStr', axis=1)
|
||||
df_workings['Vol'] = df_workings['VolStr']
|
||||
df_workings.drop('VolStr', axis=1)
|
||||
else:
|
||||
df_workings['Vol'] = (df_workings['Vol']/1e6).astype('int').astype('str') + 'm'
|
||||
debug_cols = ['Close']
|
||||
|
||||
Reference in New Issue
Block a user