Skip to content

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

Closed

Description

@davidhassell

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.

Activity

  1. self-assigned this
    on Jan 12, 2022
  2. added a commit that references this issue on Jan 12, 2022
  3. added this to the 1.9.0.2 milestone on Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions