Skip to content

Commit

Permalink
Merge pull request #170 from catalyst-cooperative/ignore-errors-harder
Browse files Browse the repository at this point in the history
Suppress warnings with 'ignore' not 'once' becuase 'once' doesn't work.
  • Loading branch information
zaneselvans authored Nov 29, 2023
2 parents 7fc8580 + d33b8af commit 31f35c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ferc_xbrl_extractor/xbrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ def table_data_from_instances(
for instance_name, fact_ids in batch["metadata"].items():
results["metadata"][instance_name] |= fact_ids

filings = {table: pd.concat(dfs) for table, dfs in results["dfs"].items()}
with warnings.catch_warnings():
warnings.filterwarnings(
action="ignore",
category=FutureWarning,
message="The behavior of DataFrame concatenation with empty or all-NA entries is deprecated",
)
filings = {table: pd.concat(dfs) for table, dfs in results["dfs"].items()}
metadata = results["metadata"]
return filings, metadata

Expand Down Expand Up @@ -169,8 +175,7 @@ def process_batch(

with warnings.catch_warnings():
warnings.filterwarnings(
action="once",
module="ferc_xbrl_extractor.xbrl",
action="ignore",
category=FutureWarning,
message="The behavior of DataFrame concatenation with empty or all-NA entries is deprecated.",
)
Expand Down

0 comments on commit 31f35c4

Please sign in to comment.