Skip to content

Broadcast erroneously claims cast_on and onto_on are equivalents of left_on and right_on parameters of pandas.merge. #37

Description

@toliwaga

They used to be, since there were passed through as of at least orca 1.1.

But now, they are assumed to be type str (or None) whereas pandas merge accepts label or list, or array-like.

So the following, which worked under orca 1.1, no longer works:

orca.broadcast(
cast='persons',
onto='trips',
cast_on=['hh_id', 'person_num'],
onto_on=['hh_id', 'person_num'])

At least the documentation should be revise, whcih currently reads:

def broadcast(cast, onto, cast_on=None, onto_on=None,
cast_index=False, onto_index=False):
"""
Register a rule for merging two tables by broadcasting one onto
the other.
Parameters
----------
cast, onto : str
Names of registered tables.
cast_on, onto_on : str, optional
Column names used for merge, equivalent of ``left_on``/``right_on``
parameters of pandas.merge.
"""

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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