8000 [Dev] Fix failing assertion in python debug by Tishj · Pull Request #7722 · duckdb/duckdb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Dev] Fix failing assertion in python debug #7722

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

Merged
merged 2 commits into from
May 29, 2023

Conversation

Tishj
Copy link
Contributor
@Tishj Tishj commented May 28, 2023
tools/pythonpkg/tests/fast/pandas/test_pandas_category.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

category = ['0', '1', '2', '3', '4', '5', ...]

    def check_create_table(category):
        conn = duckdb.connect()
    
        conn.execute ("PRAGMA enable_verification")
        df_in = pd.DataFrame({
        'x': pd.Categorical(category, ordered=True),
        'y': pd.Categorical(category, ordered=True)
        })
    
        df_out = duckdb.query_df(df_in, "data", "SELECT * FROM data").df()
        assert df_in.equals(df_out)
    
>       conn.execute("CREATE TABLE t1 AS SELECT * FROM df_in")
E       duckdb.InternalException: INTERNAL Error: Assertion triggered in file "/Users/thijs/DuckDBLabs/duckdb/src/include/duckdb/function/function_serialization.hpp" on line 28: function.deserialize

tools/pythonpkg/tests/fast/pandas/test_pandas_category.py:29: InternalException
===================================== short test summary info ======================================
FAILED tools/pythonpkg/tests/fast/pandas/test_pandas_category.py::TestCategory::test_category_string_uint8

Because some serialize functions are created, but throw a NotImplementedException, they won't have a deserialize function

Which would cause the assertion to fail.
By delaying it until after the serialization function has run, we avoid the assertion triggering in this case.

@Mytherin Mytherin merged commit 06c62ee into duckdb:master May 29, 2023
@Mytherin
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0