-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
csv import and export fixes #3135
Conversation
Adds shelved and published dates for books and their imported reviews. Provides option to create new (custom) shelves when importing books. fixes bookwyrm-social#3004 fixes bookwyrm-social#2846 fixes bookwyrm-social#2666 fixes bookwyrm-social#2411
I'm not sure how to handle the merge conflicts on this one |
I wasn't sure how to resolve the merge conflicts on this |
yeah I got distracted with other things, I need to come back to this. |
There's something wrong with my tests here ( |
Hello @hughrun! I took a look at the failures, here's the root cause (fwiw took a while to figure out!): The bookwyrm/bookwyrm/importers/bookwyrm_import.py Lines 38 to 40 in 06d6360
But The tests fail when such To fix the issue, you can remove the class BookwyrmBooksImporter(Importer):
# ...
row_mappings_guesses = Importer.row_mappings_guesses + [
("shelf_name", ["shelf_name"]),
] to avoid the bogus duplication. |
- change class attribute to instance attribute for mappings - remove comment from test - order import retry jobs in generic importer test This last change seems innocuous but I may be missing something more fundamental - it was otherwise failing when multiple tests are run, I think because running tests in parallel led to import jobs getting out of order?
Ok a couple of things here:
@dato thanks for your advice. |
I think this just needs a merge migration in order to be ready to go |
Ok there seems to be a conflict in the tests (causing some imports to finish out of order) because I'm using the same books as in |
- fix tests - revert change to GenericImporter tests - import the review name - add extra properties to ImportItem
@bookwyrm-social/code-review I think this is ready. |
Worked neatly for me! Thank you so much |
Thank you! I'm excited for when this makes out to instances in the wild. |
It seems like since merging this tests have been failing on new pull requests:
|
ugggghhhh that's the error I was getting originally, I thought I'd fixed it by not using the same books to test importing. @mouse-reeve from my own troubleshooting on this it seems that the tests sometimes return books in a slightly different order, which is what leads to this assertion error. All tests pass individually but not together, so there's something I'm not understanding that leads to this difference: perhaps tests running concurrently leading to celery tasks returning in different orders? |
Ah how frustrating! I tried re-writing that test to ignore the order of the items: #3419. It's hacky, but if it works...? |
Adds shelved and published dates for books and their imported reviews. Provides option to create new (custom) shelves when importing books.
fixes #3004
fixes #2411
@bookwyrm-social/code-review I'm looking for some clues as to why my tests fail when run sequentially but pass when run individually.