Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pt.apply.query() raises exception if the query column does not exist #377

Closed
cmacdonald opened this issue Mar 17, 2023 · 1 comment · Fixed by #380
Closed

pt.apply.query() raises exception if the query column does not exist #377

cmacdonald opened this issue Mar 17, 2023 · 1 comment · Fixed by #380
Labels
bug Something isn't working

Comments

@cmacdonald
Copy link
Contributor

No description provided.

@cmacdonald cmacdonald added the bug Something isn't working label Mar 17, 2023
@cmacdonald
Copy link
Contributor Author

    def push_queries(df: pd.DataFrame, keep_original:bool=False, inplace:bool=False) -> pd.DataFrame:
        """
            Changes a dataframe such that the "query" column becomes "query_0", and any
            "query_0" columns becames "query_1" etc.
    
            Arguments:
                df: Dataframe with a "query" column
                keep_original: if True, the query column is also left unchanged. Useful for client code.
                    Defaults to False.
                inplace: if False, a copy of the dataframe is returned. If True, changes are made to the
                    supplied dataframe. Defaults to False.
        """
        if "query" not in df.columns:
>           raise TypeError("Expected a query column, but found %s" % df.columns)
E           TypeError: Expected a query column, but found Index(['qid', 'docno', 'docid', 'rank', 'critique', 'critique_rep'], dtype='object')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant