Skip to content

[Issue]: Multiple files use deprecated DataFrame concatenation behavior with empty entries #247

@myrmarachne

Description

@myrmarachne

Summary

Environment

  • QF-Lib: 4.0.4
  • Python: 3.11.9
  • pandas: 2.2.3

What happened?

When running scripts that generate tearsheets or use Bloomberg data provider, FutureWarnings are displayed:

qf-lib\qf_lib\analysis\tearsheets\portfolio_analysis_sheet.py:310: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.                           
  all_positions_pnl = pd.concat([closed_positions_pnl, open_positions_pnl], sort=False)

qf-lib\qf_lib\data_providers\bloomberg\historical_data_provider.py:187: FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.                                                    
  tickers_data_dict[ticker] = QFDataFrame(pd.concat(

The warnings occur when concatenating DataFrames or arrays that may contain empty entries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions