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

Fix index dtype of empty dependency table #399

Merged
merged 3 commits into from
May 10, 2024
Merged

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented May 8, 2024

When publishing an empty database, the changes introduced in #372 lead to an error as the conversion to a pyarrow.Table requires the correct dtype of the index of the dependency table (audb.Dependencies._df.index). The index dtype needs to be object, see

DEPEND_INDEX_DTYPE = "object"

This is fixed here, by setting the index dtype explicitly, when instantiating the dependency object.
It also adjusts an existing test, to really the the initialization of the dependency table and not an already filled table, which is tested in test_call() already.

@hagenw hagenw marked this pull request as draft May 8, 2024 14:09
@hagenw hagenw requested a review from ChristianGeng May 8, 2024 14:25
@hagenw hagenw marked this pull request as ready for review May 8, 2024 14:25
Copy link
Member

@ChristianGeng ChristianGeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah an insidious bug.

The only thing that might be improved is the name of the test:

test___init__ does not make for a good name and the current test name test_init tries to quote the name of the method. Would maybe test_instantiation make for a good name - simply describing what it is. Apart from that, it might make sense to add a one line docstring.

Apart from that: this is a bugfix and I would simply approve it.

@hagenw
Copy link
Member Author

hagenw commented May 10, 2024

Yes, the bug only popped up when rebasing the dev branch into main, due to a test using an empty database added in #390.

Thanks for your comments, I renamed the test to test_instantiation() and added a docstring.

@hagenw hagenw merged commit c3c9490 into main May 10, 2024
7 checks passed
@hagenw hagenw deleted the fix-empty-deps-index-dtype branch May 10, 2024 05:57
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.

None yet

2 participants