-
Notifications
You must be signed in to change notification settings - Fork 535
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
[Refactor][Framework] Refactor Extractors and Converters to use Generics #3616
Comments
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs. |
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs. |
Bump |
Hello, I would like to finish this task,could you assign this to me? |
@coldgust Thanks for your interest. I've assigned this to you. |
It seems that most extractors just need to json-deserialize I want to define like this type ApiExtractorArgs[T any] struct {
RawDataSubTaskArgs
Params interface{}
Extract func(data *T, row *RawData) ([]interface{}, errors.Error)
BatchSize int
} It still pass |
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs. |
Hey @keon94 ! Is anyone working on this issue? If not can you assign it to me |
@Dev79844 I don't believe so. Sure, you can have it. Thanks for taking it on. |
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs. |
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs. |
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs. |
This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future. |
What and why to refactor
Extract functions use raw objects which they manually have to json-deserialize into predefined structs. This is needless boilerplate now that Go supports generics. Refactor the api_extractor.go (and other relevant framework files) to performs these deserializations under the hood and send the resulting Go structs to the user (Extract) functions.
The Converters suffer from this as well, although there's less boilerplate there. Refactor accordingly.
Describe the solution you'd like
Example:
currently we have:
it should become like:
The API extractor will need to take two generic parameters: for the row data and the row input - initialization will look like this:
Related issues
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: