Skip to content

[BUG] fix: release orphaned data handle after auto-format in load_data_source#180

Open
KaranSinghDev wants to merge 1 commit intosktime:mainfrom
KaranSinghDev:fix/orphaned-data-handles
Open

[BUG] fix: release orphaned data handle after auto-format in load_data_source#180
KaranSinghDev wants to merge 1 commit intosktime:mainfrom
KaranSinghDev:fix/orphaned-data-handles

Conversation

@KaranSinghDev
Copy link
Copy Markdown

@KaranSinghDev KaranSinghDev commented Apr 13, 2026

What does this implement/fix? Explain your changes.

When load_data_source runs with auto-format enabled (the default), it creates a raw data handle, then calls format_data_handle() which creates a second formatted handle. Only the formatted handle is returned to the caller, but the raw intermediate handle was never deleted from _data_handles. This caused the internal dict to grow by 2 per call instead of 1, with no cap or eviction on data handles.

Does your contribution introduce a new dependency? If yes, which one?

No

What should a reviewer concentrate their feedback on?

  1. executor.py — the two del self._data_handles[data_handle] lines, one in each code path
  2. Confirm the fallback path (where auto-format fails) is untouched and still returns the raw handle correctly

Any other comments?

I removed the original_handle from the sync response, it pointed to the deleted handle and would cause a "handle not found" error if used.

PR checklist

For all contributions
  • I've added myself to the list of contributors.
  • Optionally, I've updated sktime's CODEOWNERS to receive notifications about future changes to these files.
  • I've added unit tests and made sure they pass locally.
For new estimators
  • I've added the estimator to the online documentation.
  • I've updated the existing example notebooks or provided a new one to showcase how my estimator works.

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

Successfully merging this pull request may close these issues.

1 participant