Skip to content

Remove AllFilter and NullTransformer and improve breadth/detail of logging#146

Merged
gpauloski merged 5 commits intomainfrom
issue-122-123
Sep 6, 2024
Merged

Remove AllFilter and NullTransformer and improve breadth/detail of logging#146
gpauloski merged 5 commits intomainfrom
issue-122-123

Conversation

@gpauloski
Copy link
Copy Markdown
Contributor

Description

Note: This is a breaking change mostly because old configs that use the "all" and "null" filter and "null" transformer will fail to parse. The default behavior of TaPS is still the same.

This PR was originally about improving logging, which it does. As a part of improving logging was adding TRACE logging when an object is transformed---a helpful feature for debugging filter configurations. However, TaPS would default to an identity transformer so the logging wasn't very helpful when everything is technically transformed. I changed the transformer/filter system to support None options, which results in the aforementioned breaking config change.

Changes:

  • Added TRACE logging level
  • Added repr() implementations to many classes
  • Added more logging throughout
  • Warnings captured in logs
  • Logging now includes more granular timing information
  • Removed AllFilter and NullTransformer
  • Renamed NullFilter to NeverFilter
  • Renamed TaskInfo.function_name TaskInfo.name to reflect custom task names introduced in Add the @task() decorator so task functions can be serialized by reference #143
  • Filter and transformer options in Engine/EngineConfig now default to None
  • TaskTransformer can be used as a context manager (good for testing)
  • Improved formatting/clarity/consistency of CLI help

Fixes

Type of Change

  • Bug (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Internal (refactoring, performance, and testing)
  • Breaking (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (no changes to the code)
  • Development (CI workflows, packages, templates, etc.)
  • Package (package dependencies and versions)

Testing

Ran lots of benchmarks and updated unit tests where needed.

Pull Request Checklist

Please confirm the PR meets the following requirements.

  • Relevant tags are added (breaking, bug, documentation, enhancement, package, etc.).
  • Code changes pass pre-commit (e.g., ruff, mypy, etc.).
  • Tests have been added to show the fix is effective or that the new feature works.
  • New and existing unit tests pass locally with the changes.
  • Docs have been updated and reviewed if relevant.

Previously, the filter defaulted to an AllFilter and the transformer to
a NullTransformer. This was nice from the perspective of code
cleanliness because there were no branches for "is there a filter" or
"is there a transformer." However, this did technically mean that
everything was transformed (the transformer was an identity function).

So when addressing #123 in a prior commit, this meant that using the
default config for TaPS, every argument was getting "transformed" by the
NullTransformer, resulting in tons of useless log lines.

This commit changes the default filter and transformer to be the literal
value None, rather than no-op implementations. The corresponding
arguments to Engine, EngineConfig, and TaskTransformer were updated to
support None values. Fortunately, the TaskTransformer wrapper means that
all logic changes were isolated there (i.e., the branches for if a
filter/transformer were configured).

A tricky side-effect of this change is that _make_config_cls expects all
engine plugins to have a value so this required some changes to support
the None value path. Got that all fixed up and along the way improved
some of the outputs in the CLI help.
@gpauloski gpauloski added breaking Backwards incompatible change to public interfaces enhancement New features or improvements to existing functionality labels Sep 6, 2024
@gpauloski gpauloski merged commit f845126 into main Sep 6, 2024
@gpauloski gpauloski deleted the issue-122-123 branch September 6, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Backwards incompatible change to public interfaces enhancement New features or improvements to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add DEBUG logging for data transformation Capture warnings in logging configuration

1 participant