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

filter_by_identity fails when identities returns an itertools.chain object #170

Closed
davidhassell opened this issue Jan 12, 2022 · 0 comments · Fixed by #171
Closed

filter_by_identity fails when identities returns an itertools.chain object #170

davidhassell opened this issue Jan 12, 2022 · 0 comments · Fixed by #171
Assignees
Labels
bug Something isn't working
Milestone

Comments

@davidhassell
Copy link
Contributor

At versions 1.8.9.0 to 1.9.0.1, filter_by_identity fails when identities returns an itertools.chain object

cfdm/constructs.py",
line 1980, in _filter_by_identity
     generator.close()
AttributeError: 'itertools.chain' object has no attribute 'close'

In this case, the itertools.chain object is being passed in by cf-python (https://github.com/NCAS-CMS/cf-python/blob/v3.11.0/cf/mixin/propertiesdata.py#L4808).

I don't think that the generator needs closing here - I can't divine any memory or speed benefit, so I think just deleting that line will suffice. PR to follow.

@davidhassell davidhassell added the bug Something isn't working label Jan 12, 2022
@davidhassell davidhassell self-assigned this Jan 12, 2022
davidhassell added a commit to davidhassell/cfdm that referenced this issue Jan 12, 2022
@davidhassell davidhassell added this to the 1.9.0.2 milestone Jan 31, 2022
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
Development

Successfully merging a pull request may close this issue.

1 participant