cuddly-jelly-27016
04/10/2025, 8:34 AMlru_cache to register handlers one time.
## What changes were proposed in this pull request?
To avoid duplicated handler registration, I add @functools.lru_cache(maxsize=None) in the function decorator.
## How was this patch tested?
In master branch, when we run a workflow with pyflyte run -vvv, we can observe that lots of skipping handler registration logs are printed out.
[Screenshot 2025-04-10 at 4 19 25 PM](https://private-user-images.githubusercontent.com/26268253/432191519-c0707a4d-e531-4e90-9b8b-0fcc99402c92.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDQyOTMyMTcsIm5iZiI6MTc0NDI5MjkxNywicGF0aCI6Ii8yNjI2ODI1My80MzIxOTE1MTktYzA3MDdhNGQtZTUzMS00ZTkwLTliOGItMGZjYzk5NDAyYzkyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA0MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNDEwVDEzNDgzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE4OWQwYjY0YzU1MWJmMTdhNzE0MTQxMzcwYjNiZWYwZmZiNmNlMWMxMDYxODk3YzFlNTAwNTEzMDlkMjc1ZGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3VIFqJtbjk9jgNKxWQHmGiuM5WX6dXeEIu4q4xEXrLc)
Running this PR, the duplicated logs disappeared.
### Setup process
### Screenshots
## Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
## Related PRs
## Docs link
### Summary by Bito
This PR eliminates duplicated log outputs in Flytekit by adding functools.lru_cache decorators to structured dataset handler registration. The implementation ensures each handler is registered only once, reducing log noise and streamlining execution flow by removing redundant operations.
Unit tests added: False
Estimated effort to review (1-5, lower is better): 1
flyteorg/flytekitcuddly-jelly-27016
04/10/2025, 1:48 PM