Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

Minor: Don't recreate the Transformer for every record #3

@luandy64

Description

@luandy64

with Transformer() as transformer:

The issue with this is that the logs can get unusable because the Transformer tracks the set of all fields marked "not selected". And when the tap leaves the Transformer context manager, it prints that set.

The best approach I've seen to this problem is to create the Transfromer once per stream. And python has some interesting syntax that allows you to declare multiple contexts on one line:

with A() as a, B(some_arg) as b:
  a.do_thing()
  do_other_thing(b)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions