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

Separate type conversion from field extraction #198

Open
rseabrook opened this issue Jan 25, 2019 · 2 comments
Open

Separate type conversion from field extraction #198

rseabrook opened this issue Jan 25, 2019 · 2 comments
Labels
type:enhancement New feature or request

Comments

@rseabrook
Copy link
Contributor

When creating the tables plugin, I found that type conversion was tightly linked to field extraction in the core lib. There was no easy way to re-use the type conversion logic, so I mostly duplicated the type conversion logic inside the plugin. The lines plugin does much the same thing with yet another implementation of type conversion.

Would you be in favor of refactoring to separate type conversion from field extraction, @m3nu? That would allow the plugins to take advantage of type conversion in the core and simplify the plugin code. It would give sum field support to the plugins by default (#178) and have benefits for exception handling (#190). I wanted to get your feedback before sinking much time into the refactor.

@m3nu
Copy link
Collaborator

m3nu commented Jan 26, 2019

As we add more functionality, separating it into different modules and functions is surely a good idea. Currently we have those three stages (1 stage = 1 package here): input, extraction, output.

Your stage ("conversion"?) would go after "extraction"? Would it process one field at a time or everything at once after extraction? Like "post-extraction"?

@rseabrook
Copy link
Contributor Author

I was thinking that the extraction stage would create a full result before passing it to conversion. There are two different type conversion methods/conventions right now.

  1. Naming convention like date_ or amount_.
  2. Explicit type definition in the templates as introduced in the lines plugin.

The conversion stage would walk through the result and operate on each field as dictated by the template or field naming convention.

@bosd bosd added the type:enhancement New feature or request label Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants