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

The original function names for Memoized hydrate calls are incorrectly resolved. #738

Closed
kaidaguerre opened this issue Feb 1, 2024 · 0 comments

Comments

@kaidaguerre
Copy link
Contributor

kaidaguerre commented Feb 1, 2024

This usage is no longer supported:

Columns: awsGlobalRegionColumns([]*plugin.Column{
			{
				Name:        "account_aliases",
				Description: "A list of aliases associated with the account, if applicable.",
				Type:        proto.ColumnType_JSON,
				Transform:   transform.FromField("Aliases"),
				Hydrate: plugin.HydrateFunc(GetAccountAliases).Memoize()
			},

Instead the function to memoize must be wrapped in another hydrate:


func GetAccountAliasesUncached(ctx context.Context, d *QueryData, h *HydrateData) (interface{}, error){
	// do stuff
}

var GetAccountAliasesCached = HydrateFunc(GetAccountAliasesUncached).Memoize()

func GetAccountAliasesMemoized(ctx context.Context, d *QueryData, h *HydrateData) (interface{}, error){
   	return GetAccountAliasesCached(ctx, d, h)
}



Columns: awsGlobalRegionColumns([]*plugin.Column{
			{
				Name:        "account_aliases",
				Description: "A list of aliases associated with the account, if applicable.",
				Type:        proto.ColumnType_JSON,
				Transform:   transform.FromField("Aliases"),
				Hydrate: GetAccountAliases
			},
@kaidaguerre kaidaguerre changed the title The original function names for Memoized hydrate calls are incorrectly resolved The original function names for Memoized hydrate calls are incorrectly resolved. Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant