Skip to content

Commit

Permalink
Removed top level values to match spec
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpolygon committed Dec 24, 2024
1 parent f7aeff6 commit dff8cba
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions polygon/rest/models/financials.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,24 +371,4 @@ def from_dict(d):
start_date=d.get("start_date"),
)

# If we have an income_statement, try to pull out new fields
if sf.financials and sf.financials.income_statement:
income_stmt = sf.financials.income_statement
net_income_dp = income_stmt.get("net_income_loss")
if net_income_dp and net_income_dp.value is not None:
sf.net_income_loss = net_income_dp.value

diluted_eps_dp = income_stmt.get("diluted_earnings_per_share")
if diluted_eps_dp and diluted_eps_dp.value is not None:
sf.diluted_earnings_per_share = diluted_eps_dp.value

# If we have a comprehensive_income, pull out net income (parent)
if sf.financials and sf.financials.comprehensive_income:
comp_inc = sf.financials.comprehensive_income
net_income_parent_dp = comp_inc.get(
"net_income_loss_attributable_to_parent"
)
if net_income_parent_dp and net_income_parent_dp.value is not None:
sf.net_income_loss_attributable_to_parent = net_income_parent_dp.value

return sf

0 comments on commit dff8cba

Please sign in to comment.