Skip to content

FutureWarning in chain.py:360 when fillna on tag columns #881

@lmeyerov

Description

@lmeyerov

Repro

PYTHONPATH=. pytest tests/cypher_tck/test_tck_runner.py -k match-where1-4 -xvs

Observed

/home/lmeyerov/Work/pygraphistry2/graphistry/compute/chain.py:360: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  out_df[op._name] = out_df[op._name].fillna(False).astype('bool')

Context

The warning is raised in combine_steps when tagging node/edge columns during chain execution.

Expected

No FutureWarning when filling and coercing the tag columns.

Possible fix

Consider out_df[op._name] = out_df[op._name].fillna(False).infer_objects(copy=False).astype('bool'), or explicitly cast to boolean dtype before .fillna.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions