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

_BaseBulkloadable only resolves dependencies on first bulk run #72

Open
fromm1990 opened this issue Oct 16, 2024 · 2 comments
Open

_BaseBulkloadable only resolves dependencies on first bulk run #72

fromm1990 opened this issue Oct 16, 2024 · 2 comments

Comments

@fromm1990
Copy link
Contributor

Due to the filter on this line dependson only resolves once. The built-in filter function in python returns an iterator. Therefore, the dependson attribute can only be iterated once, hence all concecutive batchloads will not force dependencies to load.

A quick fix would be the following

self.dependson = filter(lambda b: hasattr(b, '_bulkloadnow'), dependson)
self.dependson = list(self.dependson)

or

self.dependson = [d for d in dependson if hasattr(d, '_bulkloadnow')]

Either of the two solutions results in a list which alows for multiple iterations.

@chrthomsen
Copy link
Owner

Hi,

Thanks! Good catch. I agree with the proposed solutions (with a slight preference for the 2nd).

Best regards,
Christian

@fromm1990
Copy link
Contributor Author

I have created a PR #73

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

No branches or pull requests

2 participants